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

Replaces "swap_remove" => "remove".
This commit is contained in:
Alexander Meißner 2023-08-24 16:41:04 +02:00 committed by GitHub
parent 0122ea4bca
commit 3bd14cc1e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -466,11 +466,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());