Make cl-equalp a bit more efficient at comparing strings

* lisp/emacs-lisp/cl-extra.el (cl-equalp): Use compare-strings with
the IGNORE-CASE argument, rather than creating downcased copies of the
strings to be compared.
This commit is contained in:
Noam Postavsky 2020-03-12 21:07:56 -04:00
parent 3758ff0f3a
commit 402b175f35

View file

@ -72,8 +72,7 @@ strings case-insensitively."
(cond ((eq x y) t)
((stringp x)
(and (stringp y) (= (length x) (length y))
(or (string-equal x y)
(string-equal (downcase x) (downcase y))))) ;Lazy but simple!
(eq (compare-strings x nil nil y nil nil t) t)))
((numberp x)
(and (numberp y) (= x y)))
((consp x)