test: fix fuzz test err

This commit is contained in:
Zixuan Chen 2023-07-05 19:08:27 +08:00
parent bd4060c591
commit a0a7dc1080

View file

@ -156,11 +156,13 @@ impl Actionable for Vec<LoroCore> {
text.delete(&txn, *pos, *len).unwrap(); text.delete(&txn, *pos, *len).unwrap();
} }
Action::Sync { from, to } => { Action::Sync { from, to } => {
if from != to {
let (from, to) = arref::array_mut_ref!(self, [*from as usize, *to as usize]); let (from, to) = arref::array_mut_ref!(self, [*from as usize, *to as usize]);
let to_vv = to.vv_cloned(); let to_vv = to.vv_cloned();
let from_exported = from.export(to_vv); let from_exported = from.export(to_vv);
to.import(from_exported); to.import(from_exported);
} }
}
Action::SyncAll => { Action::SyncAll => {
for i in 1..self.len() { for i in 1..self.len() {
let (a, b) = array_mut_ref!(self, [0, i]); let (a, b) = array_mut_ref!(self, [0, i]);