- (while data
- (when (and (not (gnus-data-pseudo-p data))
- (gnus-data-read-p (car data)))
- (intern (car (push (mail-header-id (gnus-data-header (car data)))
- gnus-dup-list))
- gnus-dup-hashtb))
- (pop data))
- ;; Chop off excess Message-IDs from the list.
- (let ((end (nthcdr gnus-duplicate-list-length gnus-dup-list)))
- (when end
- (setcdr end nil)))))
+ (dolist (datum gnus-newsgroup-data)
+ (when (and (not (gnus-data-pseudo-p datum))
+ (> (gnus-data-number datum) 0)
+ (not (memq (gnus-data-number datum) gnus-newsgroup-unreads))
+ (not (= (gnus-data-mark datum) gnus-canceled-mark))
+ (setq msgid (mail-header-id (gnus-data-header datum)))
+ (not (nnheader-fake-message-id-p msgid))
+ (not (intern-soft msgid gnus-dup-hashtb)))
+ (push msgid gnus-dup-list)
+ (intern msgid gnus-dup-hashtb))))
+ ;; Chop off excess Message-IDs from the list.
+ (let ((end (nthcdr gnus-duplicate-list-length gnus-dup-list)))
+ (when end
+ (mapc (lambda (id) (unintern id gnus-dup-hashtb)) (cdr end))
+ (setcdr end nil))))