driveby: fix use of indexmap remove

We do care about the order of things in this
set, in general, so use `shift_remove`.
This commit is contained in:
Niko Matsakis 2024-04-02 06:30:53 -04:00
parent 39321ed920
commit e81b22315b
2 changed files with 2 additions and 2 deletions

View file

@ -123,7 +123,7 @@ impl ActiveQuery {
pub(super) fn remove_cycle_participants(&mut self, cycle: &Cycle) {
for p in cycle.participant_keys() {
let p: DependencyIndex = p.into();
self.input_outputs.remove(&(EdgeKind::Input, p));
self.input_outputs.shift_remove(&(EdgeKind::Input, p));
}
}

View file

@ -618,7 +618,7 @@ impl ActiveQuery {
fn remove_cycle_participants(&mut self, cycle: &Cycle) {
if let Some(my_dependencies) = &mut self.dependencies {
for p in cycle.participant_keys() {
my_dependencies.remove(&p);
my_dependencies.shift_remove(&p);
}
}
}