]> git.eshelyaron.com Git - emacs.git/commit
Optimise `member` and `assoc` (etc) with constant empty list
authorMattias Engdegård <mattiase@acm.org>
Wed, 28 Jul 2021 19:07:58 +0000 (21:07 +0200)
committerMattias Engdegård <mattiase@acm.org>
Mon, 6 Sep 2021 14:47:13 +0000 (16:47 +0200)
commitfab1e220dbe38ab7a2f46b673dfc03964e496798
tree58a569827f02107d01f328c7f567fb77d6b8377e
parentba6df554755e1989670e23220d2d14bc8e389274
Optimise `member` and `assoc` (etc) with constant empty list

* lisp/emacs-lisp/byte-opt.el
(byte-optimize-assq): New.
(byte-optimize-member, byte-optimize-assoc, byte-optimize-memq):
When the list argument is constant nil, the result is always nil.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test cases.
lisp/emacs-lisp/byte-opt.el
test/lisp/emacs-lisp/bytecomp-tests.el