fn small_ran_idx_map(size: usize) -> HashMap<u64, Index> {
        // Hard-code a reasonably small here (quick will hard-code 50, which
        // is not usefull here).
        let size = 10;
        let mut rng = rand::thread_rng();
        let n: usize = rng.gen_range(0, size);
        let mut ids: Vec<usize> = (1..size).collect();
        ids.shuffle(&mut rng);
        ids.drain(n..);
        let mut idxs = [0].repeat(ids.len());
        for idx in idxs.iter_mut() {
            *idx = rng.gen_range(0, n);
        }
        let mut m = HashMap::new();
        for (i, v) in ids.iter().enumerate() {
            m.insert(*v as u64, *idxs.get(i).unwrap() as Index);
        }
        m
    }
// returns a reasonably sized map of ids to commit indexes.
returns a reasonably sized map of ids to commit indexes.
returns a reasonably sized map of ids to commit indexes .
fn small_ran_idx_map(size: usize) -> HashMap<u64, Index> {
        // Hard-code a reasonably small here (quick will hard-code 50, which
        // is not usefull here).
        let size = 10;
        let mut rng = rand::thread_rng();
        let n: usize = rng.gen_range(0, size);
        let mut ids: Vec<usize> = (1..size).collect();
        ids.shuffle(&mut rng);
        ids.drain(n..);
        let mut idxs = [0].repeat(ids.len());
        for idx in idxs.iter_mut() {
            *idx = rng.gen_range(0, n);
        }
        let mut m = HashMap::new();
        for (i, v) in ids.iter().enumerate() {
            m.insert(*v as u64, *idxs.get(i).unwrap() as Index);
        }
        m
    }
fn small_ran_idx_map ( size : usize ) -> HashMap < u64 , Index > { // Hard-code a reasonably small here (quick will hard-code 50, which // is not usefull here). let size = 10 ; let mut rng = rand :: thread_rng ( ) ; let n : usize = rng . gen_range ( 0 , size ) ; let mut ids : Vec < usize > = ( 1 .. size ) . collect ( ) ; ids . shuffle ( & mut rng ) ; ids . drain ( n .. ) ; let mut idxs = [ 0 ] . repeat ( ids . len ( ) ) ; for idx in idxs . iter_mut ( ) { * idx = rng . gen_range ( 0 , n ) ; } let mut m = HashMap :: new ( ) ; for ( i , v ) in ids . iter ( ) . enumerate ( ) { m . insert ( * v as u64 , * idxs . get ( i ) . unwrap ( ) as Index ) ; } m }
returns a reasonably sized map of ids to commit indexes.
returns a reasonably sized map of ids to commit indexes .
size
usize