summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-09-29 06:44:30 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-09-29 06:44:30 -0700
commitd20e981aeec0413c01421920d80f5b077ba95769 (patch)
tree33523b18f85fe09508ad4e315e426eb73c53137a
parent3486fd8265f5cf9b15bf8e926dbbc2f6fba2aa72 (diff)
downloadtxr-d20e981aeec0413c01421920d80f5b077ba95769.tar.gz
txr-d20e981aeec0413c01421920d80f5b077ba95769.tar.bz2
txr-d20e981aeec0413c01421920d80f5b077ba95769.zip
Simplify and optimization.
* regex.c (reg_optimize): No need to check reg_matches_all in and optimization case because the argument object has already been reduced that way by reg_optimize recursion.
-rw-r--r--regex.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/regex.c b/regex.c
index 7412b2d6..3943d93a 100644
--- a/regex.c
+++ b/regex.c
@@ -1945,11 +1945,8 @@ static val reg_optimize(val exp)
if (arg1 == t || arg2 == t)
return t;
- if (reg_matches_all(arg1)) {
- if (reg_matches_all(arg2))
- return cons(zeroplus_s, cons(wild_s, nil));
+ if (reg_matches_all(arg1))
return arg2;
- }
if (reg_matches_all(arg2))
return arg2;