aboutsummaryrefslogtreecommitdiff
path: root/src/statistics/mod.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2018-04-27 13:22:29 +0200
committerDaniel Schadt <kingdread@gmx.de>2018-04-27 13:22:29 +0200
commit1fe2fde9604db53e57996648d6d8627480391bab (patch)
treecdf77eaa1b45795b00b75ce5b1e1d52b0259be17 /src/statistics/mod.rs
parent8423b0c401a484314241391f2f78d129eef704c4 (diff)
downloadevtclib-1fe2fde9604db53e57996648d6d8627480391bab.tar.gz
evtclib-1fe2fde9604db53e57996648d6d8627480391bab.tar.bz2
evtclib-1fe2fde9604db53e57996648d6d8627480391bab.zip
speed up boon calculation
This prevents calling BoonQueue::simulate a lot of times. Still needs more profiling to make it even faster.
Diffstat (limited to 'src/statistics/mod.rs')
-rw-r--r--src/statistics/mod.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/statistics/mod.rs b/src/statistics/mod.rs
index efb934f..0a524ea 100644
--- a/src/statistics/mod.rs
+++ b/src/statistics/mod.rs
@@ -151,6 +151,9 @@ pub fn calculate(log: &Log) -> StatResult<Statistics> {
let boons = try_tracker!(boon_tracker.finalize());
for (agent, boon_map) in &boons {
let agent = agent_stats.entry(*agent).or_insert_with(Default::default);
+ if agent.exit_combat < agent.enter_combat {
+ continue;
+ }
let combat_time = agent.combat_time() as f64;
if combat_time == 0. {
continue;