heliwatch: don't create needless new states
This commit is contained in:
parent
f56244b7ef
commit
4e3504259a
|
@ -161,7 +161,7 @@ pub fn run(host: &'static str, port: u16, locations: Locations) -> Receiver<Even
|
|||
}
|
||||
|
||||
if let Some(event) = states.entry(hex.clone())
|
||||
.or_insert(State::new(hex.clone()))
|
||||
.or_insert_with(|| State::new(hex.clone()))
|
||||
.update(&entry, &locations) {
|
||||
events.push(event);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue