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

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

[elpa] externals/relint 0627d4d 08/11: Simplify (and speed up) string sc


From: Mattias Engdegård
Subject: [elpa] externals/relint 0627d4d 08/11: Simplify (and speed up) string scanning regexp
Date: Sat, 20 Jun 2020 05:57:41 -0400 (EDT)

branch: externals/relint
commit 0627d4dbf56de54ddd0508a77d794a8b56ce34f9
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    Simplify (and speed up) string scanning regexp
    
    By trusting the strings to be lexically correct, we don't need an
    elaborate pattern for handling \C-\M-something. This reduces backtracking.
---
 relint.el | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/relint.el b/relint.el
index 6c67dcc..f0557c4 100644
--- a/relint.el
+++ b/relint.el
@@ -2198,14 +2198,10 @@ STRING-START is the start of the string literal (first 
double quote)."
         (goto-char (match-end 0))
         (while (not (looking-at (rx (or ?\" eot))))
           (when (looking-at
-                 (rx (1+ (or (seq
-                              ?\\ (any "0-9" "xuUN" "abfnrtv"
-                                       "des" "^" " "
-                                       ?\\ ?\n ?\"))
-                             (seq
-                              (1+ ?\\ (any "CM") "-")
-                              (or (not (any ?\\))
-                                  (seq ?\\ anything)))
+                 (rx (1+ (or (seq ?\\ (any "0-9" "xuUN" "abfnrtv"
+                                           "des" "^" " "
+                                           ?\\ ?\n ?\"
+                                           "CM"))
                              (not (any ?\\ ?\"))))))
             (goto-char (match-end 0)))
           (when (eq (following-char) ?\\)



reply via email to

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