Remove warnings and refactor some code

This commit is contained in:
2022-12-16 19:46:01 +01:00
parent 912a282cd8
commit 2bdd3d9b89
3 changed files with 13 additions and 40 deletions

View File

@@ -81,7 +81,7 @@ impl Event {
.collect::<Vec<_>>()
}
fn within_priors(
pub(crate) fn within_priors(
&self,
online: bool,
forward: bool,
@@ -283,26 +283,6 @@ impl Batch {
.collect::<HashMap<_, _>>()
}
// TODO(anders): Remove this function.
pub(crate) fn within_priors(
&self,
event: usize,
online: bool,
forward: bool,
agents: &HashMap<Index, Agent>,
) -> Vec<Vec<Player>> {
self.events[event]
.teams
.iter()
.map(|team| {
team.items
.iter()
.map(|item| item.within_prior(online, forward, &self.skills, agents))
.collect::<Vec<_>>()
})
.collect::<Vec<_>>()
}
pub(crate) fn iteration(&mut self, from: usize, agents: &HashMap<Index, Agent>) {
for event in self.events.iter_mut().skip(from) {
let teams = event.within_priors(false, false, &self.skills, agents);