diff options
author | Kim F. Storm <storm@cua.dk> | 2006-10-22 22:37:51 +0000 |
---|---|---|
committer | Kim F. Storm <storm@cua.dk> | 2006-10-22 22:37:51 +0000 |
commit | f9c625632572033f75a9e76e8aa2ce47c6122ba9 (patch) | |
tree | f40fb82ec3628ce2ed9d6b13947fc3c413ca9f6a /lisp/subr.el | |
parent | 052c5438c7edba450cd5d7f2fe44c3859d557b3a (diff) | |
download | emacs-f9c625632572033f75a9e76e8aa2ce47c6122ba9.tar.gz |
(add-to-list): Fix last change--optimize for no compare-fn.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r-- | lisp/subr.el | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index 957d098703f..43ecfd56108 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1101,18 +1101,18 @@ into a hook function that will be run only after loading the package. `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 |