diff options
| author | David Kastrup | 2006-10-30 22:49:04 +0000 |
|---|---|---|
| committer | David Kastrup | 2006-10-30 22:49:04 +0000 |
| commit | 2d1dd54d7daeb318aa6a50d7fc93d436c666fde0 (patch) | |
| tree | b99257f5c094b998fc14e56c1405e4d65cd7e483 | |
| parent | 5fb9c53c678be2bbfdf038eae7f80167014c8e87 (diff) | |
| download | emacs-2d1dd54d7daeb318aa6a50d7fc93d436c666fde0.tar.gz emacs-2d1dd54d7daeb318aa6a50d7fc93d436c666fde0.zip | |
(add-to-list): Don't continue checking if a match has
been found.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/subr.el | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9be9e30590b..c1902d0a1a4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2006-10-30 David Kastrup <dak@gnu.org> | ||
| 2 | |||
| 3 | * subr.el (add-to-list): Don't continue checking if a match has | ||
| 4 | been found. | ||
| 5 | |||
| 1 | 2006-10-30 Chong Yidong <cyd@stupidchicken.com> | 6 | 2006-10-30 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 7 | ||
| 3 | * tutorial.el: Move defvars to avoid bytecomp warnings. | 8 | * tutorial.el: Move defvars to avoid bytecomp warnings. |
diff --git a/lisp/subr.el b/lisp/subr.el index 43ecfd56108..cf09264e4b1 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -1108,11 +1108,11 @@ other hooks, such as major mode hooks, can do the job." | |||
| 1108 | ((eq compare-fn 'eql) | 1108 | ((eq compare-fn 'eql) |
| 1109 | (memql element (symbol-value list-var))) | 1109 | (memql element (symbol-value list-var))) |
| 1110 | (t | 1110 | (t |
| 1111 | (let (present) | 1111 | (let ((lst (symbol-value list-var))) |
| 1112 | (dolist (elt (symbol-value list-var)) | 1112 | (while (and lst |
| 1113 | (if (funcall compare-fn element elt) | 1113 | (not (funcall compare-fn element (car lst)))) |
| 1114 | (setq present t))) | 1114 | (setq lst (cdr lst))) |
| 1115 | present))) | 1115 | lst))) |
| 1116 | (symbol-value list-var) | 1116 | (symbol-value list-var) |
| 1117 | (set list-var | 1117 | (set list-var |
| 1118 | (if append | 1118 | (if append |