Skip to content

Commit 5a35bd9

Browse files
committed
csgrep: chain filters based on the predicate keys
... sorted alphabetically It would make more sense if the predicates that are cheap to evaluate (or the predicates that drop more data) were chained first. On the other hand, when processing big data sets, the biggest bottleneck is usually the JSON reader/writer anyway. PR: #51
1 parent 981e8f0 commit 5a35bd9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/csgrep.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,13 +492,13 @@ bool chainFiltersCore(
492492
const po::variables_map &vm,
493493
const TFlags flags)
494494
{
495-
return appendPredIfNeeded<CheckerPredicate> (pf, vm, flags, "checker")
496-
&& appendPredIfNeeded<SrcAnnotPredicate> (pf, vm, flags, "src-annot")
497-
&& appendPredIfNeeded<AnnotPredicate> (pf, vm, flags, "annot")
495+
return appendPredIfNeeded<AnnotPredicate> (pf, vm, flags, "annot")
496+
&& appendPredIfNeeded<CheckerPredicate> (pf, vm, flags, "checker")
498497
&& appendPredIfNeeded<ErrorPredicate> (pf, vm, flags, "error")
499498
&& appendPredIfNeeded<KeyEventPredicate> (pf, vm, flags, "event")
500499
&& appendPredIfNeeded<MsgPredicate> (pf, vm, flags, "msg")
501-
&& appendPredIfNeeded<PathPredicate> (pf, vm, flags, "path");
500+
&& appendPredIfNeeded<PathPredicate> (pf, vm, flags, "path")
501+
&& appendPredIfNeeded<SrcAnnotPredicate> (pf, vm, flags, "src-annot");
502502
}
503503

504504
bool chainFilters(

0 commit comments

Comments
 (0)