pub fn visit<F>(&mut self, mut f: F)
    where
        F: FnMut(u64, &mut Progress),
    {
        let n = self.progress.len();
        // We need to sort the IDs and don't want to allocate since this is hot code.
        // The optimized here mirrors that in `(MajorityConfig).CommittedIndex`,
        // see there for details
        // TODO optimized
        let mut ids: Vec<u64> = Vec::new();
        ids.extend(self.progress.keys().into_iter());
        ids.sort_by_key(|k| *k);
        for id in ids {
            let progress = self.progress.get_mut(&id).unwrap();
            f(id, progress);
        }
    }
// visit invokes the supplied closure for all tracked progresses in stable order.
visit invokes the supplied closure for all tracked progresses in stable order.
visit invokes the supplied closure for all tracked progresses in stable order .
pub fn visit<F>(&mut self, mut f: F)
    where
        F: FnMut(u64, &mut Progress),
    {
        let n = self.progress.len();
        // We need to sort the IDs and don't want to allocate since this is hot code.
        // The optimized here mirrors that in `(MajorityConfig).CommittedIndex`,
        // see there for details
        // TODO optimized
        let mut ids: Vec<u64> = Vec::new();
        ids.extend(self.progress.keys().into_iter());
        ids.sort_by_key(|k| *k);
        for id in ids {
            let progress = self.progress.get_mut(&id).unwrap();
            f(id, progress);
        }
    }
pub fn visit < F > ( & mut self , mut f : F ) where F : FnMut ( u64 , & mut Progress ) , { let n = self . progress . len ( ) ; // We need to sort the IDs and don't want to allocate since this is hot code. // The optimized here mirrors that in `(MajorityConfig).CommittedIndex`, // see there for details // TODO optimized let mut ids : Vec < u64 > = Vec :: new ( ) ; ids . extend ( self . progress . keys ( ) . into_iter ( ) ) ; ids . sort_by_key ( | k | * k ) ; for id in ids { let progress = self . progress . get_mut ( & id ) . unwrap ( ) ; f ( id , progress ) ; } }
visit invokes the supplied closure for all tracked progresses in stable order.
visit invokes the supplied closure for all tracked progresses in stable order .
&mut self
f
F