pub(super) fn prune_committee(
        &self,
        quorum: Weight,
        mut committee: Committee,
    ) -> (Committee, BTreeSet<ValidatorIndex>) {
        let mut pruned = BTreeSet::new();
        loop {
            let sees_quorum = |idx: &ValidatorIndex| {
                self.seen_weight(self.state.unit(self.latest[*idx].unwrap()), &committee) >= quorum
            };
            let (new_committee, new_pruned): (Vec<_>, Vec<_>) =
                committee.iter().cloned().partition(sees_quorum);
            if new_pruned.is_empty() {
                return (new_committee, pruned);
            }
            pruned.extend(new_pruned);
            committee = new_committee;
        }
    }
/// Returns the greatest subset of the `committee` of validators whose latest units can see a
/// quorum of units by the subset in `self`.
///
/// The first returned value is the pruned committee, the second one are the validators that
/// were pruned.
///
/// Panics if a member of the committee is not in `self.latest`. This can never happen if the
/// committee was computed from a `Horizon` that originated from the same `level0` as this one.
Returns the greatest subset of the `committee` of validators whose latest units can see a
quorum of units by the subset in `self`.

The first returned value is the pruned committee, the second one are the validators that
were pruned.

Panics if a member of the committee is not in `self.latest`. This can never happen if the
committee was computed from a `Horizon` that originated from the same `level0` as this one.
Returns the greatest subset of the ` committee ` of validators whose latest units can see a quorum of units by the subset in ` self ` . The first returned value is the pruned committee the second one are the validators that were pruned . Panics if a member of the committee is not in ` self . latest ` . This can never happen if the committee was computed from a ` Horizon ` that originated from the same ` level0 ` as this one .
pub(super) fn prune_committee(
        &self,
        quorum: Weight,
        mut committee: Committee,
    ) -> (Committee, BTreeSet<ValidatorIndex>) {
        let mut pruned = BTreeSet::new();
        loop {
            let sees_quorum = |idx: &ValidatorIndex| {
                self.seen_weight(self.state.unit(self.latest[*idx].unwrap()), &committee) >= quorum
            };
            let (new_committee, new_pruned): (Vec<_>, Vec<_>) =
                committee.iter().cloned().partition(sees_quorum);
            if new_pruned.is_empty() {
                return (new_committee, pruned);
            }
            pruned.extend(new_pruned);
            committee = new_committee;
        }
    }
pub ( super ) fn prune_committee ( & self , quorum : Weight , mut committee : Committee , ) -> ( Committee , BTreeSet < ValidatorIndex > ) { let mut pruned = BTreeSet :: new ( ) ; loop { let sees_quorum = | idx : & ValidatorIndex | { self . seen_weight ( self . state . unit ( self . latest [ * idx ] . unwrap ( ) ) , & committee ) >= quorum } ; let ( new_committee , new_pruned ) : ( Vec < _ > , Vec < _ > ) = committee . iter ( ) . cloned ( ) . partition ( sees_quorum ) ; if new_pruned . is_empty ( ) { return ( new_committee , pruned ) ; } pruned . extend ( new_pruned ) ; committee = new_committee ; } }
Returns the greatest subset of the `committee` of validators whose latest units can see a
quorum of units by the subset in `self`.
Returns the greatest subset of the ` committee ` of validators whose latest units can see a quorum of units by the subset in ` self ` .
&self
quorum
Weight
committee
Committee
&self
quorum
Weight
committee
Committee