1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Revert "Obsolete local set difference functions in favor of seq-difference"

This reverts commit 20f7fa691b.

gnus-set-difference is orders of magnitude faster than seq-difference
(on these sets), and using seq-difference makes nnimap too
slow.
This commit is contained in:
Lars Ingebrigtsen 2021-09-29 17:25:01 +02:00
parent e457cff3f4
commit b4b4cc98ac
7 changed files with 27 additions and 18 deletions

View file

@ -710,8 +710,16 @@ finds ham or spam.")
(defun spam-set-difference (list1 list2)
"Return a set difference of LIST1 and LIST2.
When either list is nil, the other is returned."
(declare (obsolete seq-difference "28.1"))
(seq-difference list1 list2 #'eq))
(if (and list1 list2)
;; we have two non-nil lists
(progn
(dolist (item (append list1 list2))
(when (and (memq item list1) (memq item list2))
(setq list1 (delq item list1))
(setq list2 (delq item list2))))
(append list1 list2))
;; if either of the lists was nil, return the other one
(if list1 list1 list2)))
(defun spam-group-ham-mark-p (group mark &optional spam)
"Checks if MARK is considered a ham mark in GROUP."
@ -1319,7 +1327,7 @@ In the case of mover backends, checks the setting of
(new-articles (spam-list-articles
gnus-newsgroup-articles
classification))
(changed-articles (seq-difference new-articles old-articles #'eq)))
(changed-articles (spam-set-difference new-articles old-articles)))
;; now that we have the changed articles, we go through the processors
(dolist (backend (spam-backend-list))
(let (unregister-list)