diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-29 06:44:30 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-29 06:44:30 -0700 |
commit | d20e981aeec0413c01421920d80f5b077ba95769 (patch) | |
tree | 33523b18f85fe09508ad4e315e426eb73c53137a | |
parent | 3486fd8265f5cf9b15bf8e926dbbc2f6fba2aa72 (diff) | |
download | txr-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.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -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; |