emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/relint 099b59f 01/23: Reorder strings in regexp for mor


From: Mattias Engdegård
Subject: [elpa] externals/relint 099b59f 01/23: Reorder strings in regexp for more efficient matching
Date: Sun, 29 Sep 2019 15:34:50 -0400 (EDT)

branch: externals/relint
commit 099b59f06c812ab4b769c1341f7c8479f90c217b
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>

    Reorder strings in regexp for more efficient matching
    
    Avoiding prefixes before prefixed strings allows regexp-opt to work better.
---
 relint.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/relint.el b/relint.el
index 310be99..66fd0a2 100644
--- a/relint.el
+++ b/relint.el
@@ -1251,7 +1251,7 @@ return (NAME); on syntax error, return nil."
           (when (symbolp name)
             (cond
              ((or (relint--defcustom-type-regexp-p type)
-                  (string-match-p (rx (or "-regexp" "-re" "-regex" "-pattern")
+                  (string-match-p (rx (or "-regexp" "-regex" "-re" "-pattern")
                                       eos)
                                   (symbol-name name)))
               (relint--check-re re-arg name file pos (cons 2 path))
@@ -1274,7 +1274,7 @@ return (NAME); on syntax error, return nil."
                        (eq (car type) 'repeat)
                        (relint--defcustom-type-regexp-p (cadr type)))
                   (string-match-p (rx (or (or "-regexps" "-regexes")
-                                          (seq (or "-regexp" "-re" "-regex")
+                                          (seq (or "-regexp" "-regex" "-re")
                                                "-list"))
                                       eos)
                                   (symbol-name name)))
@@ -1289,7 +1289,7 @@ return (NAME); on syntax error, return nil."
               (relint--check-compilation-error-regexp-alist-alist
                re-arg name file pos (cons 2 path))
               (push name relint--checked-variables))
-             ((string-match-p (rx (or "-regexp" "-re" "-regex" "-pattern")
+             ((string-match-p (rx (or "-regexp" "-regex" "-re" "-pattern")
                                   "-alist" eos)
                               (symbol-name name))
               (relint--check-list-any re-arg name file pos (cons 2 path))



reply via email to

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