From e81b22315b0012992398691763f617b3bb27d878 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 2 Apr 2024 06:30:53 -0400 Subject: [PATCH] driveby: fix use of indexmap remove We do care about the order of things in this set, in general, so use `shift_remove`. --- components/salsa-2022/src/runtime/active_query.rs | 2 +- src/runtime.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/salsa-2022/src/runtime/active_query.rs b/components/salsa-2022/src/runtime/active_query.rs index ebe33a48..67ea202e 100644 --- a/components/salsa-2022/src/runtime/active_query.rs +++ b/components/salsa-2022/src/runtime/active_query.rs @@ -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)); } } diff --git a/src/runtime.rs b/src/runtime.rs index 20bf20ed..d0b616a4 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -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); } } }