hunter: avoid double lookup in Scheduler::introduce()

This commit is contained in:
Astro 2023-04-24 18:48:31 +02:00
parent daed3f3280
commit 18de86dde2
1 changed files with 2 additions and 2 deletions

View File

@ -49,8 +49,8 @@ impl Scheduler {
let now = Instant::now();
let host = Arc::new(host);
if self.instances.get(&host).is_none() {
self.instances.insert(host.clone(), Instance {
if let std::collections::hash_map::Entry::Vacant(entry) = self.instances.entry(host.clone()) {
entry.insert(Instance {
last_fetch: None,
error: false,
});