emacs-diffs
[Top][All Lists]
Advanced

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

master 075e77ac449: * src/regex-emacs.c (regex_compile): Remove useless


From: Mattias Engdegård
Subject: master 075e77ac449: * src/regex-emacs.c (regex_compile): Remove useless condition
Date: Mon, 19 Jun 2023 04:40:42 -0400 (EDT)

branch: master
commit 075e77ac449386c07a4b90e052d1bef7c6a38771
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    * src/regex-emacs.c (regex_compile): Remove useless condition
    
    This condition didn't have any visible effect (as ^ is not a
    repetition operator); all it did was to generate slightly worse regexp
    bytecode for out-of-place (literal) ^ in the midst of literal
    characters (bug#64128).
---
 src/regex-emacs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/regex-emacs.c b/src/regex-emacs.c
index e3237cd425a..fea34df991b 100644
--- a/src/regex-emacs.c
+++ b/src/regex-emacs.c
@@ -2597,7 +2597,7 @@ regex_compile (re_char *pattern, ptrdiff_t size,
 
              /* If followed by a repetition operator.  */
              || (p != pend
-                 && (*p == '*' || *p == '+' || *p == '?' || *p == '^'))
+                 && (*p == '*' || *p == '+' || *p == '?'))
              || (p + 1 < pend && p[0] == '\\' && p[1] == '{'))
            {
              /* Start building a new exactn.  */



reply via email to

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