Skip to content

Commit

Permalink
clean up add_changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cowlicks committed Mar 29, 2024
1 parent 8fa79be commit 4ff8206
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl Blocks {
self.cache.read().await.get(seq).cloned()
}

pub async fn get_from_core(
async fn get_from_core(
&self,
seq: &u64,
blocks: Shared<Self>,
Expand Down Expand Up @@ -112,10 +112,11 @@ impl Blocks {
trace!("Adding changes with # non-root nodes [{}]", nodes.len());
let mut new_nodes = vec![];

let n_nodes_in_block = nodes.len() + 1; // +1 from root
let n_nodes_in_block: u64 = n_nodes_in_block.try_into().unwrap();
// NB: the + 1u64 is from the root
// Could # nodes be greater than u64? No way.
let n_nodes_in_block: u64 = 1u64 + nodes.len() as u64;

let root = root.expect("Root *should* always be added in the put/del logic");
let root = root.expect("Root *must* always be added in the put/del logic");

// re-order nodes to match js hyperbee
// and update their offset
Expand Down

0 comments on commit 4ff8206

Please sign in to comment.