emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 402b175 2/2: Make cl-equalp a bit more efficient at comparing str


From: Noam Postavsky
Subject: master 402b175 2/2: Make cl-equalp a bit more efficient at comparing strings
Date: Thu, 12 Mar 2020 21:29:34 -0400 (EDT)

branch: master
commit 402b175f358c948b5207924fd2f48c4666ca1c0a
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    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 e9bfe8d..323bbbb 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]