diff options
author | Dave Abrahams <dave@boostpro.com> | 2012-08-31 04:39:30 +0000 |
---|---|---|
committer | Katsumi Yamaoka <yamaoka@jpl.org> | 2012-08-31 04:39:30 +0000 |
commit | c20643e2105117277d0b1d1880848e2ab31b967c (patch) | |
tree | db11e3362bdc77f1b50027ce191b22f18bc399f8 /lisp/gnus/gnus-range.el | |
parent | 4e0f64791b6f38bfaa8d84addf7a472a15aac111 (diff) | |
download | emacs-c20643e2105117277d0b1d1880848e2ab31b967c.tar.gz emacs-c20643e2105117277d0b1d1880848e2ab31b967c.tar.bz2 emacs-c20643e2105117277d0b1d1880848e2ab31b967c.zip |
[Gnus] Miscellaneous fixes by Dave Abrahams
Diffstat (limited to 'lisp/gnus/gnus-range.el')
-rw-r--r-- | lisp/gnus/gnus-range.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/gnus/gnus-range.el b/lisp/gnus/gnus-range.el index 68729da0910..091276ee4f8 100644 --- a/lisp/gnus/gnus-range.el +++ b/lisp/gnus/gnus-range.el @@ -52,11 +52,13 @@ If RANGE is a single range, return (RANGE). Otherwise, return RANGE." (defun gnus-set-difference (list1 list2) "Return a list of elements of LIST1 that do not appear in LIST2." - (let ((list1 (copy-sequence list1))) - (while list2 - (setq list1 (delq (car list2) list1)) - (setq list2 (cdr list2))) - list1)) + (let ((hash2 (make-hash-table :test 'eq)) + (result nil)) + (dolist (elt list2) (puthash elt t hash2)) + (dolist (elt list1) + (unless (gethash elt hash2) + (setq result (cons elt result)))) + (nreverse result))) (defun gnus-range-nconcat (&rest ranges) "Return a range comprising all the RANGES, which are pre-sorted. |