branch: externals/relint
commit c8fd9222c36c1f45d32eeb2dcfdb70a956281f4a
Author: Mattias Engdegård <matti...@acm.org>
Commit: Mattias Engdegård <matti...@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