From: Kim F. Storm Date: Wed, 20 Sep 2006 23:12:15 +0000 (+0000) Subject: (pushnew): Rework 2006-09-10 change. Use memql X-Git-Tag: emacs-pretest-22.0.90~423 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5bde639f478b246e33bfb74f03e8f8ccfa7542f9;p=emacs.git (pushnew): Rework 2006-09-10 change. Use memql instead of add-to-list in the simple case. --- diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 53bec05ddc3..3399f7e7b20 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -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)))