MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / drop_below

Method drop_below

nodedb-array/src/sync/op_log.rs:119–125  ·  view source on GitHub ↗
(&self, hlc: Hlc)

Source from the content-addressed store, hash-verified

117 }
118
119 fn drop_below(&self, hlc: Hlc) -> ArrayResult<u64> {
120 let mut guard = self.lock()?;
121 let before = guard.len() as u64;
122 guard.retain(|(_, hlc_bytes), _| Hlc::from_bytes(hlc_bytes) >= hlc);
123 let after = guard.len() as u64;
124 Ok(before - after)
125 }
126}
127
128#[cfg(test)]

Callers 2

collapse_belowFunction · 0.45

Calls 2

lockMethod · 0.80
lenMethod · 0.45

Tested by 1