~dkellner/chronofold

029579c03df4f5cc6fd4b5fe32bae0e717c0c0f6 — Dominik Kellner 2 years ago 8607a71
Fix type errors in benchmarks
1 files changed, 3 insertions(+), 3 deletions(-)

M benches/dmonad.rs
M benches/dmonad.rs => benches/dmonad.rs +3 -3
@@ 93,12 93,12 @@ fn insert_chars_at_random_positions(c: &mut Criterion) {
        positions_and_chars,
        |sess, (pos, c)| {
            let idx = if pos == 0 {
                None // insert as first element
                LogIndex(0) // insert as first element
            } else {
                // This is expected to be really slow, as accessing a specific
                // position (as opposed to a log index) requires walking the
                // linked list up to that position.
                Some(sess.as_ref().iter().nth(pos - 1).unwrap().1)
                sess.as_ref().iter().nth(pos - 1).unwrap().1
            };
            sess.insert_after(idx, c);
        },


@@ 238,7 238,7 @@ fn measure_space<T, F: Fn(&mut Sess<'_>, T)>(name: &str, input: Vec<T>, apply_ch
    for d in input.into_iter() {
        let mut session = cfold.session(1);
        apply_change(&mut session, d);
        for op in session.iter_ops() {
        for op in session.iter_ops::<&char>() {
            total_ops_bytes += serde_json::to_vec(&op).unwrap().len();
        }
    }