aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Steingold2022-06-21 18:41:13 -0400
committerSam Steingold2022-06-21 18:41:42 -0400
commit6f5f2ebfb4fe2652152bc0f69d6a1ffde3ec5c87 (patch)
tree08da5535c7f783aeab4065bfbb06b52dfac95bad
parent5e40c5a3beaccdea956abf9d0be0631cb7d2e1d2 (diff)
downloademacs-6f5f2ebfb4fe2652152bc0f69d6a1ffde3ec5c87.tar.gz
emacs-6f5f2ebfb4fe2652152bc0f69d6a1ffde3ec5c87.zip
A trivial optimization and a formatting fix
* lisp/subr.el (internal--compiler-macro-cXXr): Re-use `head' for `n'. Fix indentation and line length.
-rw-r--r--lisp/subr.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index d14efccd82e..04eec977bb6 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -540,12 +540,12 @@ i.e., subtract 2 * `most-negative-fixnum' from VALUE before shifting it."
540;; you may want to amend the other, too. 540;; you may want to amend the other, too.
541(defun internal--compiler-macro-cXXr (form x) 541(defun internal--compiler-macro-cXXr (form x)
542 (let* ((head (car form)) 542 (let* ((head (car form))
543 (n (symbol-name (car form))) 543 (n (symbol-name head))
544 (i (- (length n) 2))) 544 (i (- (length n) 2)))
545 (if (not (string-match "c[ad]+r\\'" n)) 545 (if (not (string-match "c[ad]+r\\'" n))
546 (if (and (fboundp head) (symbolp (symbol-function head))) 546 (if (and (fboundp head) (symbolp (symbol-function head)))
547 (internal--compiler-macro-cXXr (cons (symbol-function head) (cdr form)) 547 (internal--compiler-macro-cXXr
548 x) 548 (cons (symbol-function head) (cdr form)) x)
549 (error "Compiler macro for cXXr applied to non-cXXr form")) 549 (error "Compiler macro for cXXr applied to non-cXXr form"))
550 (while (> i (match-beginning 0)) 550 (while (> i (match-beginning 0))
551 (setq x (list (if (eq (aref n i) ?a) 'car 'cdr) x)) 551 (setq x (list (if (eq (aref n i) ?a) 'car 'cdr) x))