* 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).
This commit is contained in:
Mattias Engdegård 2023-06-19 10:25:15 +02:00
parent edb0862f5e
commit 075e77ac44

View file

@ -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. */