Skip to content

Commit

Permalink
jobs: manager: simplify logic using HashMap::entry()
Browse files Browse the repository at this point in the history
  • Loading branch information
hnez committed Aug 27, 2024
1 parent 2f119de commit 175f056
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/jobs/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@ impl Manager {
let oar = job.triplet().clone().into_owner_and_repo();
let run_id = job.run_id();

if let Some(run_ids) = res.get_mut(&oar) {
run_ids.insert(run_id);
} else {
let run_ids = HashSet::from_iter([run_id]);
res.insert(oar, run_ids);
}
res.entry(oar).or_default().insert(run_id);
}
}

Expand Down

0 comments on commit 175f056

Please sign in to comment.