aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2020-03-12 21:07:56 -0400
committerNoam Postavsky2020-03-12 21:07:56 -0400
commit402b175f358c948b5207924fd2f48c4666ca1c0a (patch)
tree8499d3b410a16cdc46507a67c2112b13d5ff9f43
parent3758ff0f3ad365b7a56c3e63a8d0d5f00f3d5085 (diff)
downloademacs-402b175f358c948b5207924fd2f48c4666ca1c0a.tar.gz
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.
-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."
72 (cond ((eq x y) t) 72 (cond ((eq x y) t)
73 ((stringp x) 73 ((stringp x)
74 (and (stringp y) (= (length x) (length y)) 74 (and (stringp y) (= (length x) (length y))
75 (or (string-equal x y) 75 (eq (compare-strings x nil nil y nil nil t) t)))
76 (string-equal (downcase x) (downcase y))))) ;Lazy but simple!
77 ((numberp x) 76 ((numberp x)
78 (and (numberp y) (= x y))) 77 (and (numberp y) (= x y)))
79 ((consp x) 78 ((consp x)