From d20e981aeec0413c01421920d80f5b077ba95769 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 29 Sep 2015 06:44:30 -0700 Subject: 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. --- regex.c | 5 +---- 1 file changed, 1 insertion(+), 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; -- cgit v1.2.3