summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-07-03 19:05:44 -0700
committerKaz Kylheku <kaz@kylheku.com>2024-07-03 19:05:44 -0700
commit9aa751c8a4f845ef2d2bba091c81ffeded941afd (patch)
treebad5ad6a84f1fe05f353d757aea30c962b4d785e
parent0ccf4483d8ed2ad5805116df5dba4a858e5c373a (diff)
downloadtxr-9aa751c8a4f845ef2d2bba091c81ffeded941afd.tar.gz
txr-9aa751c8a4f845ef2d2bba091c81ffeded941afd.tar.bz2
txr-9aa751c8a4f845ef2d2bba091c81ffeded941afd.zip
regex: eliminate unnecessary stack push.
* regex.c (scan_until_common): in the REGM_MATCH case, there is no need to push the current character into the unget stack. That character is not supposed to be pushed back, and it won't be because it's below the match point; the stack node just ends up recycled at the end of the function.
-rw-r--r--regex.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/regex.c b/regex.c
index eda096f3..aaddec64 100644
--- a/regex.c
+++ b/regex.c
@@ -3237,7 +3237,6 @@ static val scan_until_common(val self, val regex, val stream_in,
match = stack;
goto out_match;
case REGM_MATCH:
- push(ch, &stack);
match = stack;
continue;
case REGM_INCOMPLETE: