pub fn committed_index<T: AckedIndexer>(&self, l: &T) -> Index {
        if self.is_empty() {
            // This plays well with joint quorum which, when one of half is the zero
            // MajorityConfig, should behave like the other half.
            return u64::max_value();
        }
        // Use a on-stack slice to collect the committed indexes when n <= 7
        // (otherwise we alloc). The alternative is to stash a slice on
        // MajorityConfig, but this impairs usability (as is, MajorityConfig is just
        // a map, and that's nice). The assumption is that running with a
        // performance is a lesser concern (additionally the performance
        // implication of an allocation here are far from drastic).
        // TODO: optimized use stack
        let n = self.len();
        let mut srt: Vec<u64> = [0].repeat(n);
        let mut i = 0;
        for id in self.iter() {
            if let Some(idx) = l.acked_index(&id) {
                srt[i as usize] = *idx;
                i += 1;
            }
        }

        srt.sort_by_key(|key| *key);
        let pos = n - (n / 2 + 1);
        srt[pos]
    }
/// commit_index computes the committed index from those supplied via the
/// provide acked_index (for the active config).
commit_index computes the committed index from those supplied via the
provide acked_index (for the active config).
commit_index computes the committed index from those supplied via the provide acked_index ( for the active config ) .
pub fn committed_index<T: AckedIndexer>(&self, l: &T) -> Index {
        if self.is_empty() {
            // This plays well with joint quorum which, when one of half is the zero
            // MajorityConfig, should behave like the other half.
            return u64::max_value();
        }
        // Use a on-stack slice to collect the committed indexes when n <= 7
        // (otherwise we alloc). The alternative is to stash a slice on
        // MajorityConfig, but this impairs usability (as is, MajorityConfig is just
        // a map, and that's nice). The assumption is that running with a
        // performance is a lesser concern (additionally the performance
        // implication of an allocation here are far from drastic).
        // TODO: optimized use stack
        let n = self.len();
        let mut srt: Vec<u64> = [0].repeat(n);
        let mut i = 0;
        for id in self.iter() {
            if let Some(idx) = l.acked_index(&id) {
                srt[i as usize] = *idx;
                i += 1;
            }
        }
        srt.sort_by_key(|key| *key);
        let pos = n - (n / 2 + 1);
        srt[pos]
    }
pub fn committed_index < T : AckedIndexer > ( & self , l : & T ) -> Index { if self . is_empty ( ) { // This plays well with joint quorum which, when one of half is the zero // MajorityConfig, should behave like the other half. return u64 :: max_value ( ) ; } // Use a on-stack slice to collect the committed indexes when n <= 7 // (otherwise we alloc). The alternative is to stash a slice on // MajorityConfig, but this impairs usability (as is, MajorityConfig is just // a map, and that's nice). The assumption is that running with a // performance is a lesser concern (additionally the performance // implication of an allocation here are far from drastic). // TODO: optimized use stack let n = self . len ( ) ; let mut srt : Vec < u64 > = [ 0 ] . repeat ( n ) ; let mut i = 0 ; for id in self . iter ( ) { if let Some ( idx ) = l . acked_index ( & id ) { srt [ i as usize ] = * idx ; i += 1 ; } } srt . sort_by_key ( | key | * key ) ; let pos = n - ( n / 2 + 1 ) ; srt [ pos ] }
commit_index computes the committed index from those supplied via the
provide acked_index (for the active config).
commit_index computes the committed index from those supplied via the provide acked_index ( for the active config ) .
&self
l
&T