From f956baf7e6b77e48e3f845459560f1f8fb77eb7c Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 29 Apr 2020 16:18:02 +0200 Subject: fix BossFilter::filter_early If the boss is unknown, we exclude the log - that is how BossFilter::filter operates, and it is probably what the user wants if they specify a -boss filter. However, in filter_early, the default for unknown bosses was to return Inclusion::Include, which is not consistent with filter. That lead to some logs being included, parsed and then thrown away again. This change makes the behaviour for unknown bosses between filter_early and filter consistent, and therefore speeds up the search if -boss is used. --- src/filters/log.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/filters') diff --git a/src/filters/log.rs b/src/filters/log.rs index 6be7acc..59e6b8c 100644 --- a/src/filters/log.rs +++ b/src/filters/log.rs @@ -25,7 +25,7 @@ impl Filter for BossFilter { fn filter_early(&self, partial_evtc: &PartialEvtc) -> Inclusion { let boss = Boss::from_u16(partial_evtc.header.combat_id); boss.map(|b| self.0.contains(&b).into()) - .unwrap_or(Inclusion::Include) + .unwrap_or(Inclusion::Exclude) } fn filter(&self, log: &LogResult) -> bool { -- cgit v1.2.3