Skip to main content

diff_participation

Function diff_participation 

Source
pub fn diff_participation(base: &[u8], target: &[u8]) -> ParticipationDiff
Expand description

Computes a compact delta between two participation flag slices.

The returned ParticipationDiff contains the information required to reconstruct target from base.

If every flag in target is zero, the function uses the specialized ParticipationDiff::AllZeros representation. Otherwise it produces a sparse delta containing only modified flags.

This is the contiguous-slice convenience API. Clients whose participation flags are stored in a non-contiguous representation can use diff_participation_iter instead.

ยงComplexity

O(n) time and O(m) additional space, where n is the number of flags examined and m is the number of modified flags.