We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents cac9918 + 6a66ae2 commit eb337e5Copy full SHA for eb337e5
vm/src/dictdatatype.rs
@@ -248,9 +248,13 @@ impl<T: Clone> Dict<T> {
248
if let Some(index) = entry_index.index() {
249
// Update existing key
250
if let Some(entry) = inner.entries.get_mut(index) {
251
- let entry = entry
252
- .as_mut()
253
- .expect("The dict was changed since we did lookup.");
+ let Some(entry) = entry.as_mut() else {
+ // The dict was changed since we did lookup. Let's try again.
+ // this is very rare to happen
254
+ // (and seems only happen with very high freq gc, and about one time in 10000 iters)
255
+ // but still possible
256
+ continue;
257
+ };
258
if entry.index == index_index {
259
let removed = std::mem::replace(&mut entry.value, value);
260
// defer dec RC
0 commit comments