Subject: Re: bug#34852: 26.1; seq-intersection ignores nil as element

From: Michael Heerdegen <[email-masked]>
Date: Wed, 20 Mar 2019 23:33:18 +0100

Nicolas Petton <[email-masked]> writes:

> +(cl-defgeneric seq-contains-p (sequence elt &optional testfn)
> +  "Return non-nil if SEQUENCE contains an element equal to ELT.
> +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)))
> +      nil))

A detail: could you factor out the result of (or testfn #'equal) so that
`or' is not called repeatedly in the loop?

Michael.