]> git.eshelyaron.com Git - emacs.git/commit
Improved nconc and append compiler optimisations
authorMattias Engdegård <mattiase@acm.org>
Thu, 20 Apr 2023 13:07:06 +0000 (15:07 +0200)
committerMattias Engdegård <mattiase@acm.org>
Sat, 22 Apr 2023 07:47:23 +0000 (09:47 +0200)
commite6ca5834a6eab91023e9f968b65683d0a74db1e7
tree146b8d8e64cd321fd41871354ee16758f1bbfce8
parent4f3dae2b0d5fc43e5e2effa6d36544b6de2a43d8
Improved nconc and append compiler optimisations

Add the transforms:

  (nconc) -> nil
  (nconc X) -> X

and for arguments to `nconc`:

  nil -> <elided>
  (list X...) (list Y...) -> (list X... Y...)
  (list X) Y -> (cons X Y)

* lisp/emacs-lisp/byte-opt.el (byte-optimize-nconc): New.
(byte-optimize-append): Fix minor flaws and generalise.
lisp/emacs-lisp/byte-opt.el