Fix bounds check -- was panicking on remove because `added_delta` was -1
This commit is contained in:
parent
aa0271a493
commit
4beee7f924
|
@ -443,7 +443,7 @@ fn apply_opts<K: Eq + Hash>(
|
|||
}
|
||||
|
||||
// We can optimize appends.
|
||||
if cmds.added_delta != 0
|
||||
if cmds.added_delta > 0
|
||||
&& cmds.moving == 0
|
||||
&& if let DiffOp::Add { at, .. } = cmds.ops[0] {
|
||||
at >= from.len()
|
||||
|
|
Loading…
Reference in New Issue