changeset 73466:c470e5e21c36

(add-to-list): Fix last change--optimize for no compare-fn.
author Kim F. Storm <storm@cua.dk>
date Sun, 22 Oct 2006 22:37:51 +0000
parents 03050ee24abc
children 09426117d117
files lisp/subr.el
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Sun Oct 22 22:32:53 2006 +0000
+++ b/lisp/subr.el	Sun Oct 22 22:37:51 2006 +0000
@@ -1101,18 +1101,18 @@
 `eval-after-load' provides one way to do this.  In some cases
 other hooks, such as major mode hooks, can do the job."
   (if (cond
+       ((null compare-fn)
+	(member element (symbol-value list-var)))
        ((eq compare-fn 'eq)
 	(memq element (symbol-value list-var)))
        ((eq compare-fn 'eql)
 	(memql element (symbol-value list-var)))
-       (compare-fn
+       (t
 	(let (present)
 	  (dolist (elt (symbol-value list-var))
 	    (if (funcall compare-fn element elt)
 		(setq present t)))
-	  present))
-       (t
-	(member element (symbol-value list-var))))
+	  present)))
       (symbol-value list-var)
     (set list-var
 	 (if append