mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-28 10:56:36 +00:00
Add fast-path to ert--explain-string-equal
* lisp/emacs-lisp/ert.el (ert--explain-string-equal): Add fast-path to avoid doing extra work. Problem reported by Mattias Engdegård <mattiase@acm.org>.
This commit is contained in:
parent
94af99b298
commit
b8b1d8dee7
@ -543,9 +543,11 @@ Returns nil if they are."
|
|||||||
(defun ert--explain-string-equal (a b)
|
(defun ert--explain-string-equal (a b)
|
||||||
"Explainer function for `string-equal'."
|
"Explainer function for `string-equal'."
|
||||||
;; Convert if they are symbols.
|
;; Convert if they are symbols.
|
||||||
|
(if (string-equal a b)
|
||||||
|
nil
|
||||||
(let ((as (if (symbolp a) (symbol-name a) a))
|
(let ((as (if (symbolp a) (symbol-name a) a))
|
||||||
(bs (if (symbolp b) (symbol-name b) b)))
|
(bs (if (symbolp b) (symbol-name b) b)))
|
||||||
(ert--explain-equal-rec as bs)))
|
(ert--explain-equal-rec as bs))))
|
||||||
(put 'string-equal 'ert-explainer 'ert--explain-string-equal)
|
(put 'string-equal 'ert-explainer 'ert--explain-string-equal)
|
||||||
|
|
||||||
(defun ert--significant-plist-keys (plist)
|
(defun ert--significant-plist-keys (plist)
|
||||||
|
Loading…
Reference in New Issue
Block a user