Skip to main content

diff_balances

Function diff_balances 

Source
pub fn diff_balances(base: &[u64], target: &[u64]) -> BalancesDiff
Expand description

Computes a compact delta between two balance snapshots.

The returned delta contains sufficient information to reconstruct target from base.

§Complexity

O(n)

§Panics

Never.

§Notes

The most common balance difference is stored separately as a mode and all encoded differences are stored relative to this mode, improving varint compression.