Skip to content

Commit

Permalink
fix: number of watches reported was way to high
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra committed Nov 28, 2024
1 parent 1fbaff0 commit 33e0686
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/internal/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ impl<TId: ArenaId, TValue> Mapping<TId, TValue> {
.resize_with(chunk + 1, || std::array::from_fn(|_| None));
}
let previous_value = self.chunks[chunk][offset].replace(value);
self.len += 1;
if previous_value.is_none() {
self.len += 1;
}
self.max = self.max.max(idx);
previous_value
}
Expand Down

0 comments on commit 33e0686

Please sign in to comment.