aboutsummaryrefslogtreecommitdiff
path: root/src/analyzers
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2021-11-18 19:37:05 +0100
committerDaniel Schadt <kingdread@gmx.de>2021-11-18 19:37:05 +0100
commitae884762ca300b265355afb6aeaed5010352f167 (patch)
treef29d683c2ee30a957bcbc7463abd01b685bfa282 /src/analyzers
parent7dceef6f8f9e2cc5d3ce57177d2d7ac3abad7a5b (diff)
downloadevtclib-ae884762ca300b265355afb6aeaed5010352f167.tar.gz
evtclib-ae884762ca300b265355afb6aeaed5010352f167.tar.bz2
evtclib-ae884762ca300b265355afb6aeaed5010352f167.zip
switch order of operands in SH analyzer
Comparing the int is a very cheap operation, and it is also a very good indicator already that we've found the right event. Due to the short circuiting behaviour of &&, it is better to check that first before doing the Log::is_boss check - which is relatively costly. Remember that we do this check for every buff application event! This brings a speedup of around 50x: new: 654.1±25.18µs old: 34.9±0.69ms
Diffstat (limited to 'src/analyzers')
-rw-r--r--src/analyzers/raids/w5.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/analyzers/raids/w5.rs b/src/analyzers/raids/w5.rs
index 747bda2..d00eab8 100644
--- a/src/analyzers/raids/w5.rs
+++ b/src/analyzers/raids/w5.rs
@@ -46,7 +46,7 @@ impl<'log> Analyzer for SoullessHorror<'log> {
..
} = event.kind()
{
- self.log.is_boss(*destination_agent_addr) && *buff_id == DESMINA_DEATH_BUFF
+ *buff_id == DESMINA_DEATH_BUFF && self.log.is_boss(*destination_agent_addr)
} else {
false
}