diff options
| author | Rudi Grinberg <rudi.grinberg@gmail.com> | 2018-03-07 00:26:37 +0700 |
|---|---|---|
| committer | Rudi Grinberg <rudi.grinberg@gmail.com> | 2018-03-07 00:26:37 +0700 |
| commit | 718b03fb4220e8b23868ce9f7eef2bb9cf789448 (patch) | |
| tree | 99eee58d9f0c76eb83b28e5bcfbeead2dbc952ad | |
| parent | 0611c329d61c897c04de6ac0f9bdd42256c52d99 (diff) | |
Use string-match-p when possible
In some situations, we don't use the match data. So we might as well not capture
it.
| -rw-r--r-- | evil-common.el | 6 | ||||
| -rw-r--r-- | evil-core.el | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/evil-common.el b/evil-common.el index f0fe68a..d320fd0 100644 --- a/evil-common.el +++ b/evil-common.el @@ -488,13 +488,13 @@ If any character set is complemented, the result is also complemented." (let ((bracket "") (complement "") (hyphen "") result) (save-match-data (dolist (set sets) - (when (string-match "^\\^" set) + (when (string-match-p "^\\^" set) (setq set (substring set 1) complement "^")) - (when (string-match "^]" set) + (when (string-match-p "^]" set) (setq set (substring set 1) bracket "]")) - (when (string-match "^-" set) + (when (string-match-p "^-" set) (setq set (substring set 1) hyphen "-")) (setq result (concat result set))) diff --git a/evil-core.el b/evil-core.el index eb23eed..d88a102 100644 --- a/evil-core.el +++ b/evil-core.el @@ -898,14 +898,14 @@ does not already exist." (defun evil-auxiliary-keymap-p (map) "Whether MAP is an auxiliary keymap." (and (keymapp map) - (string-match "Auxiliary keymap" - (or (keymap-prompt map) "")) t)) + (string-match-p "Auxiliary keymap" + (or (keymap-prompt map) "")) t)) (defun evil-minor-mode-keymap-p (map) "Whether MAP is a minor-mode keymap." (and (keymapp map) - (string-match "Minor-mode keymap" - (or (keymap-prompt map) "")) t)) + (string-match-p "Minor-mode keymap" + (or (keymap-prompt map) "")) t)) (defun evil-intercept-keymap-p (map &optional state) "Whether MAP is an intercept keymap for STATE. |
