]> git.eshelyaron.com Git - emacs.git/commitdiff
alist-get instead of assoc cdr
authorAndrea Corallo <akrl@sdf.org>
Thu, 3 Oct 2019 20:15:43 +0000 (22:15 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:37:55 +0000 (11:37 +0100)
lisp/emacs-lisp/comp.el

index 9f808d2704b4cd3449066ec342428f27f099c0fd..584a02af0e3ef20702632b86a90593e428f3fe2a 100644 (file)
@@ -389,7 +389,7 @@ Put PREFIX in front of it."
         (error "Can't native compile an already bytecompiled function"))
       (setf (comp-func-byte-func func)
             (byte-compile (comp-func-symbol-name func)))
-      (let ((lap (cdr (assoc function-name (reverse byte-to-native-bytecode)))))
+      (let ((lap (alist-get function-name (reverse byte-to-native-bytecode))))
         (cl-assert lap)
         (comp-log lap)
         (let ((lambda-list (aref (comp-func-byte-func func) 0)))
@@ -409,7 +409,7 @@ Put PREFIX in front of it."
                              ('defconst (cdr x))))
                          byte-to-native-top-level-forms)))
   (cl-loop for (name . bytecode) in (remove-if-not #'car byte-to-native-bytecode)
-           for lap = (cdr (assoc name byte-to-native-lap))
+           for lap = (alist-get name byte-to-native-lap)
            for lambda-list = (aref bytecode 0)
            for func = (make-comp-func :symbol-name name
                                       :byte-func bytecode
@@ -1330,12 +1330,12 @@ This can run just once."
      (pcase rval
        (`(,(or 'call 'direct-call) ,f . ,_)
         (setf (comp-mvar-type lval)
-              (cdr (assq f comp-known-ret-types))))
+              (alist-get f comp-known-ret-types)))
        (`(,(or 'callref 'direct-callref) ,f . ,args)
         (cl-loop for v in args
                  do (setf (comp-mvar-ref v) t))
         (setf (comp-mvar-type lval)
-              (cdr (assq f comp-known-ret-types))))
+              (alist-get f comp-known-ret-types)))
        (_
         (comp-mvar-propagate lval rval))))
     (`(phi ,lval . ,rest)