Skip to content

Commit

Permalink
fix(hdom): off-by-one error when updating child offsets after removal
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Apr 5, 2019
1 parent 64f4703 commit beef4e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/hdom/src/diff.ts
Expand Up @@ -116,7 +116,7 @@ export const diffTree = <T>(
// DEBUG && console.log("remove @", offsets[idx], val);
releaseTree(val);
impl.removeChild(el, offsets[idx]);
for (j = prevLength; j >= idx; j--) {
for (j = prevLength; j > idx; j--) {
offsets[j] = max(offsets[j] - 1, 0);
}
}
Expand Down

0 comments on commit beef4e9

Please sign in to comment.