Function: byte-optimize-assoc

byte-optimize-assoc is a byte-compiled function defined in byte-opt.el.gz.

Signature

(byte-optimize-assoc FORM)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/byte-opt.el.gz
(defun byte-optimize-assoc (form)
  ;; Replace 2-argument `assoc' with `assq', `rassoc' with `rassq',
  ;; if the first arg is a symbol or fixnum.
  (cond
   ((/= (length form) 3)
    form)
   ((null (nth 2 form))                 ; empty list
    `(progn ,(nth 1 form) nil))
   ((or (byte-optimize--constant-symbol-p (nth 1 form))
        (byte-optimize--fixnump (nth 1 form)))
    (cons (if (eq (car form) 'assoc) 'assq 'rassq)
          (cdr form)))
   (t (byte-optimize-constant-args form))))