MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / reconstruct_num_rows

Method reconstruct_num_rows

crates/table/src/page.rs:1192–1196  ·  view source on GitHub ↗

Use this page's present rows bitvec to compute the number of present rows. This can be compared with [`Self::num_rows`] as a consistency check during tests.

(&self)

Source from the content-addressed store, hash-verified

1190 ///
1191 /// This can be compared with [`Self::num_rows`] as a consistency check during tests.
1192 pub fn reconstruct_num_rows(&self) -> usize {
1193 // If we cared, we could rewrite this to `u64::count_ones` on each block of the bitset.
1194 // We do not care. This method is slow.
1195 self.header.fixed.present_rows.iter_set().count()
1196 }
1197
1198 /// Returns the number of var-len granules allocated in this page.
1199 ///

Callers 1

Calls 2

iter_setMethod · 0.80
countMethod · 0.65

Tested by

no test coverage detected