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
commite7ce1b7d7da3fdebee6d5ba67f359bc6e3bb9e52 (patch)
treebad5ad6a84f1fe05f353d757aea30c962b4d785e
parent5ac8f56a9248dfe0d2d6d7abbba48e38d4a9e60e (diff)
downloadtxr-e7ce1b7d7da3fdebee6d5ba67f359bc6e3bb9e52.tar.gz
txr-e7ce1b7d7da3fdebee6d5ba67f359bc6e3bb9e52.tar.bz2
txr-e7ce1b7d7da3fdebee6d5ba67f359bc6e3bb9e52.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: