(seq-contains-p): Refine the non-nil returned value
* lisp/emacs-lisp/seq.el (seq-contains-p): Like `cl-some` return the value returned by the test function rather than t.
This commit is contained in:
parent
6ed3f04e5a
commit
81bcad03e9
1 changed files with 3 additions and 2 deletions
|
@ -418,8 +418,9 @@ Equality is defined by TESTFN if non-nil or by `equal' if nil."
|
|||
Equality is defined by TESTFN if non-nil or by `equal' if nil."
|
||||
(catch 'seq--break
|
||||
(seq-doseq (e sequence)
|
||||
(when (funcall (or testfn #'equal) e elt)
|
||||
(throw 'seq--break t)))
|
||||
(let ((r (funcall (or testfn #'equal) e elt)))
|
||||
(when r
|
||||
(throw 'seq--break r))))
|
||||
nil))
|
||||
|
||||
(cl-defgeneric seq-set-equal-p (sequence1 sequence2 &optional testfn)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue