Skip to content

Commit 97471a2

Browse files
Merge pull request itsybitesyspider#6 from itsybitesyspider/bugfix/3
Bugfix/3
2 parents 2227d8b + 8911381 commit 97471a2

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,18 @@ mod test {
833833
.or_insert_with(|| X(1, 0));
834834
}
835835

836+
#[test]
837+
fn test_duplicate_clean() {
838+
let mut storage: Storage<u64, u64, X> = Storage::new();
839+
840+
storage.add(X(0, 0));
841+
842+
storage.entry(&ID.chunk(0).item(0));
843+
storage.remove(&ID.chunk(0).item(0), std::mem::drop);
844+
845+
storage.validate();
846+
}
847+
836848
#[test]
837849
fn test_str() {
838850
let mut storage: Storage<str, str, S> = Storage::new();

src/types/storage.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ where
235235
}
236236

237237
self.dirty.sort_unstable();
238+
self.dirty.dedup();
238239

239240
for idx in self.dirty.iter().rev() {
240241
if !self.chunks[*idx].is_empty() {

0 commit comments

Comments
 (0)