Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
v1.16: Fix - Reordering in second level index of LoadedPrograms (back…
Browse files Browse the repository at this point in the history
…port of #32973) (#32977)

Fix - Reordering in second level index of LoadedPrograms (#32973)

Replaces "swap_remove" => "remove".

(cherry picked from commit 3bd14cc)

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
  • Loading branch information
mergify[bot] and Lichtso authored Aug 24, 2023
1 parent 9b06ca8 commit abf3914
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions program-runtime/src/loaded_programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,11 @@ impl LoadedPrograms {
existing.ix_usage_counter.load(Ordering::Relaxed),
Ordering::Relaxed,
);
second_level.swap_remove(entry_index);
second_level.remove(entry_index);
} else if existing.is_tombstone() && !entry.is_tombstone() {
// The old entry is tombstone and the new one is not. Let's give the new entry
// a chance.
second_level.swap_remove(entry_index);
second_level.remove(entry_index);
} else {
self.stats.replacements.fetch_add(1, Ordering::Relaxed);
return (true, existing.clone());
Expand Down

0 comments on commit abf3914

Please sign in to comment.