From 402b175f358c948b5207924fd2f48c4666ca1c0a Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 12 Mar 2020 21:07:56 -0400 Subject: [PATCH] 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. --- lisp/emacs-lisp/cl-extra.el | 3 +-- 1 file changed, 1 insertion(+), 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) -- 2.39.2