~mht/cra

d843e51411d0da5a2ba39c14e07a8166c4aa4200 — Martin Hafskjold Thoresen 4 months ago bae1de7 master
Fix bug where a boundary would be padded with zeros.

Since `slow_vec` is filled with `0` when created, so that we can index
into it, it thinks that the zeros are a part of the final boundary,
when they really just are placeholders.
1 files changed, 5 insertions(+), 0 deletions(-)

M src/persistence.rs
M src/persistence.rs => src/persistence.rs +5 -0
@@ 240,6 240,11 @@ fn simplex_reduce(this: &mut Simplex, other: &Simplex) {
            this.faces.push(n);
        }
    } else {
        // The `unsafe` will never overshoot.
        assert!(buffer_i <= num_inds);
        unsafe {
            slow_vec.set_len(buffer_i);
        }
        std::mem::swap(&mut this.faces, &mut slow_vec);
    }
}