Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/store/weight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -811,8 +811,7 @@ where
///
/// `total_weight` is reset *before* dropping the map contents so that
/// under `panic = "unwind"` a panicking `V::Drop` still leaves the
/// store in a self-consistent state (`map.len() == 0`, the hashbrown
/// `ClearOnDrop` guard guarantees this; `total_weight == 0`).
/// store in a self-consistent state (`map.len() == 0`; `total_weight == 0`).
/// Remaining values may leak via the unwinding drop, but no stale
/// weight baseline can inflate future capacity checks.
///
Expand Down Expand Up @@ -1159,8 +1158,9 @@ where
/// Removes all entries and resets total weight.
///
/// Acquires write lock. Attributes the cleared entries to the outer
/// `removes` metric. Inner-store counters are ignored here so the
/// public metrics surface counts each bulk clear exactly once.
/// `removes` metric. Inner-store metrics counters are not consulted
/// here; removal count is derived from `store.map.len()` so the public
/// metrics surface counts each bulk clear exactly once.
fn clear(&self) {
let mut store = self.inner.write();
let removed = store.map.len() as u64;
Expand Down
Loading