Fix bounds check -- was panicking on remove because `added_delta` was -1

This commit is contained in:
Greg Johnston 2022-12-03 13:43:05 -05:00
parent aa0271a493
commit 4beee7f924
1 changed files with 1 additions and 1 deletions

View File

@ -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()