]> git.eshelyaron.com Git - emacs.git/commitdiff
(pushnew): Rework 2006-09-10 change. Use memql
authorKim F. Storm <storm@cua.dk>
Wed, 20 Sep 2006 23:12:15 +0000 (23:12 +0000)
committerKim F. Storm <storm@cua.dk>
Wed, 20 Sep 2006 23:12:15 +0000 (23:12 +0000)
instead of add-to-list in the simple case.

lisp/emacs-lisp/cl.el

index 53bec05ddc373a9e8f4cb39aa3dcc287481daa59..3399f7e7b20d4d826673c3213110b53fa863e705 100644 (file)
@@ -159,9 +159,7 @@ an element already on the list.
 \n(fn X PLACE [KEYWORD VALUE]...)"
   (if (symbolp place)
       (if (null keys)
-         `(let ((pushnew-internal ,place))
-            (add-to-list 'pushnew-internal ,x nil 'eql)
-            (setq ,place pushnew-internal))
+         `(if (memql ,x ,place) ,place (setq ,place (cons ,x ,place)))
        (list 'setq place (list* 'adjoin x place keys)))
     (list* 'callf2 'adjoin x place keys)))