mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
(member*): Use memql instead of complex code.
Suggested by Miles Bader.
This commit is contained in:
parent
5bde639f47
commit
eae510750d
1 changed files with 1 additions and 15 deletions
|
|
@ -2578,21 +2578,7 @@ surrounded by (block NAME ...).
|
|||
(cl-const-expr-val (nth 1 keys)))))
|
||||
(cond ((eq test 'eq) (list 'memq a list))
|
||||
((eq test 'equal) (list 'member a list))
|
||||
((or (null keys) (eq test 'eql))
|
||||
(if (eq (cl-const-expr-p a) t)
|
||||
(list (if (floatp-safe (cl-const-expr-val a)) 'member 'memq)
|
||||
a list)
|
||||
(if (eq (cl-const-expr-p list) t)
|
||||
(let ((p (cl-const-expr-val list)) (mb nil) (mq nil))
|
||||
(if (not (cdr p))
|
||||
(and p (list 'eql a (list 'quote (car p))))
|
||||
(while p
|
||||
(if (floatp-safe (car p)) (setq mb t)
|
||||
(or (integerp (car p)) (symbolp (car p)) (setq mq t)))
|
||||
(setq p (cdr p)))
|
||||
(if (not mb) (list 'memq a list)
|
||||
(if (not mq) (list 'member a list) form))))
|
||||
form)))
|
||||
((or (null keys) (eq test 'eql)) (list 'memql a list))
|
||||
(t form))))
|
||||
|
||||
(define-compiler-macro assoc* (&whole form a list &rest keys)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue