[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.
- [elpa] externals/relint updated (fdfb2d7 -> a146c2c), Mattias Engdegård, 2019/04/13
- [elpa] externals/relint 973241a 1/9: Fix typo in comment, Mattias Engdegård, 2019/04/13
- [elpa] externals/relint 88ccc9c 2/9: Stronger regexp-generating variable check, Mattias Engdegård, 2019/04/13
- [elpa] externals/relint b8f617e 4/9: Various code simplifications,
Mattias Engdegård <=
- [elpa] externals/relint cf39690 3/9: Clean-ups and safety fixes, Mattias Engdegård, 2019/04/13
- [elpa] externals/relint c315148 6/9: Treat #' and , @ correctly when finding position, Mattias Engdegård, 2019/04/13
- [elpa] externals/relint 301b803 5/9: Use doc strings instead of comments preceding functions, Mattias Engdegård, 2019/04/13
- [elpa] externals/relint 2471efb 8/9: Detailed diagnostics descriptions in README.org, Mattias Engdegård, 2019/04/13
- [elpa] externals/relint a146c2c 9/9: Increment version to 1.7, Mattias Engdegård, 2019/04/13
- [elpa] externals/relint 7db3e2e 7/9: Collect all functions, macros and aliases, Mattias Engdegård, 2019/04/13