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

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

[elpa] externals/relint c8fd922 12/16: Minor looking-at optimisation


From: Mattias Engdegård
Subject: [elpa] externals/relint c8fd922 12/16: Minor looking-at optimisation
Date: Mon, 30 Nov 2020 05:00:59 -0500 (EST)

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

    Minor looking-at optimisation
    
    Replace call to `looking-at` with `following-char` when only a single
    character is matched: faster, and does not consume regexp cache.
---
 relint.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/relint.el b/relint.el
index 1b8a69e..5ab667e 100644
--- a/relint.el
+++ b/relint.el
@@ -2251,9 +2251,9 @@ STRING-START is the start of the string literal (first 
double quote)."
                                   (seq ";" (0+ nonl))
                                   (not (any ?\" ?\; ?? ?\\))))))
       (goto-char (match-end 0)))
-    (when (looking-at (rx ?\"))
+    (when (eq (following-char) ?\")
       (let ((string-start (point)))
-        (goto-char (match-end 0))
+        (forward-char)
         (while (not (looking-at (rx (or ?\" eot))))
           (when (looking-at
                  (rx (1+ (or (seq ?\\ (any "0-9" "xuUN" "abfnrtv"



reply via email to

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