emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/relint b8f617e 4/9: Various code simplifications


From: Mattias Engdegård
Subject: [elpa] externals/relint b8f617e 4/9: Various code simplifications
Date: Sat, 13 Apr 2019 12:51:30 -0400 (EDT)

branch: externals/relint
commit b8f617ea8625fa8f2dae9e49a22b46f6b2aacc91
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>

    Various code simplifications
    
    Suggested by Stefan Monnier.
---
 relint.el | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/relint.el b/relint.el
index 17b8be4..bd4cbdd 100644
--- a/relint.el
+++ b/relint.el
@@ -320,16 +320,14 @@
    ((symbolp form)
     (if (memq form relint--safe-functions)
         form
-      (let ((alt (cdr (assq form relint--safe-alternatives))))
-        (if alt
-            alt
+      (or (cdr (assq form relint--safe-alternatives))
           (let ((def (cdr (assq form relint--function-defs))))
             (if def
                 (let ((formals (car def))
                       (expr (cadr def)))
                   (lambda (&rest args)
                     (relint--apply formals args expr)))
-              'relint--no-value))))))
+              'relint--no-value)))))
    ((and (consp form) (eq (car form) 'lambda))
     (let ((formals (cadr form))
           (body (cddr form)))
@@ -853,11 +851,10 @@
        (setq body (cdr body)))          ; Skip doc and declarations.
      ;; Only consider functions/macros with single-expression bodies.
      (when (= (length body) 1)
-       (let ((entry (list name args (car body))))
-         (if (eq (car form) 'defmacro)
-             (push entry relint--macro-defs)
-           (push entry relint--function-defs))
-         ))
+       (push (list name args (car body))
+             (if (eq (car form) 'defmacro)
+                 relint--macro-defs
+               relint--function-defs)))
 
      ;; If any argument looks like a regexp, remember it so that it can be
      ;; checked in calls.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]