Skip to main content

split_with

Function split_with 

Source
pub fn split_with(
    entries: &BTreeMap<String, LeanEntry>,
    target: usize,
    min: usize,
    max: usize,
) -> LeanResult<Vec<(ChunkRef, Vec<u8>)>>
Expand description

Split entries into chunk bodies and their references.

BTreeMap iterates in sorted order and LeanEntry holds no floats, so identical entry sets encode to identical bytes and therefore to identical addresses. That determinism is not a nicety — it is the whole dedup mechanism: an untouched chunk must re-address to the object that already exists, or every publish uploads everything.