summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2020-03-12 21:07:56 -0400
committerNoam Postavsky <npostavs@gmail.com>2020-03-12 21:07:56 -0400
commit402b175f358c948b5207924fd2f48c4666ca1c0a (patch)
tree8499d3b410a16cdc46507a67c2112b13d5ff9f43 /lisp/emacs-lisp
parent3758ff0f3ad365b7a56c3e63a8d0d5f00f3d5085 (diff)
downloademacs-402b175f358c948b5207924fd2f48c4666ca1c0a.tar.gz
emacs-402b175f358c948b5207924fd2f48c4666ca1c0a.tar.bz2
emacs-402b175f358c948b5207924fd2f48c4666ca1c0a.zip
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.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/cl-extra.el3
1 files changed, 1 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index e9bfe8df5f2..323bbbbf947 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -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)