Skip to content

Commit 25e547c

Browse files
committed
aumap: avoid duplicated values
1 parent 9cd11cc commit 25e547c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/providers/file/aumap.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,13 @@ where
206206
}
207207

208208
fn insert_or_update(&mut self, key: K, val: V) {
209+
let key = key.into();
209210
let val = val.into();
210-
*self.pending.entry(key.into()).or_insert(val) = val;
211+
// Check if the value already known
212+
if self.get(key.into()).map(V::into) == Some(val) {
213+
return;
214+
}
215+
*self.pending.entry(key).or_insert(val) = val;
211216
}
212217
}
213218

0 commit comments

Comments
 (0)