]> git.eshelyaron.com Git - emacs.git/commitdiff
Revert "alist-get testfn argument evaluation correction"
authorEli Zaretskii <eliz@gnu.org>
Fri, 16 Dec 2022 17:29:30 +0000 (19:29 +0200)
committerEli Zaretskii <eliz@gnu.org>
Fri, 16 Dec 2022 17:29:30 +0000 (19:29 +0200)
This reverts commit 17d65c99cd812e085d85f790c83ec0d540490a55.

Please don't install unnecessary improvements on the release
branch.

lisp/emacs-lisp/gv.el

index 48bc0269f36e42a66b87fcafe45998a3e674662a..11251d7a963091e57a535ae42d748225f8afe939 100644 (file)
@@ -417,9 +417,9 @@ The return value is the last VAL in the list.
   (lambda (do key alist &optional default remove testfn)
     (macroexp-let2 macroexp-copyable-p k key
       (gv-letplace (getter setter) alist
-        (macroexp-let2 nil p (if (member testfn '(nil 'eq #'eq))
-                                 `(assq ,k ,getter)
-                               `(assoc ,k ,getter ,testfn))
+        (macroexp-let2 nil p `(if (and ,testfn (not (eq ,testfn 'eq)))
+                                  (assoc ,k ,getter ,testfn)
+                                (assq ,k ,getter))
           (funcall do (if (null default) `(cdr ,p)
                         `(if ,p (cdr ,p) ,default))
                    (lambda (v)