aboutsummaryrefslogtreecommitdiff
path: root/src/filters/log.rs
diff options
context:
space:
mode:
authorDaniel <kingdread@gmx.de>2020-04-29 16:18:02 +0200
committerDaniel <kingdread@gmx.de>2020-04-29 16:18:02 +0200
commitf956baf7e6b77e48e3f845459560f1f8fb77eb7c (patch)
treeefad054650251cf268fa007f78fc7010998988a9 /src/filters/log.rs
parent5e38bdfa8662ed5bdc100004f206e467cff9e6b5 (diff)
downloadraidgrep-f956baf7e6b77e48e3f845459560f1f8fb77eb7c.tar.gz
raidgrep-f956baf7e6b77e48e3f845459560f1f8fb77eb7c.tar.bz2
raidgrep-f956baf7e6b77e48e3f845459560f1f8fb77eb7c.zip
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.
Diffstat (limited to 'src/filters/log.rs')
-rw-r--r--src/filters/log.rs2
1 files changed, 1 insertions, 1 deletions
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<PartialEvtc, LogResult> 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 {