From 305ee902874b49351f4916e303c293523f11570b Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 22 May 2020 12:20:10 -0400 Subject: opt: Track data flow information about predicates This allows us to optimize things like -sparse -o -not -sparse <==> -true and -sparse -a -not -sparse <==> -false --- parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'parse.c') diff --git a/parse.c b/parse.c index d5c0128..8269d22 100644 --- a/parse.c +++ b/parse.c @@ -1759,7 +1759,7 @@ static struct expr *parse_nogroup(struct parser_state *state, int arg1, int arg2 struct expr *expr = parse_nullary_test(state, eval_nogroup); if (expr) { - expr->cost = 9000.0; + expr->cost = STAT_COST; expr->probability = 0.01; } return expr; @@ -1793,7 +1793,7 @@ static struct expr *parse_nouser(struct parser_state *state, int arg1, int arg2) struct expr *expr = parse_nullary_test(state, eval_nouser); if (expr) { - expr->cost = 9000.0; + expr->cost = STAT_COST; expr->probability = 0.01; } return expr; -- cgit v1.2.3