Skip to content

Commit

Permalink
fix endless loop when re-offsetting postponed updates
Browse files Browse the repository at this point in the history
  • Loading branch information
knaeckeKami committed Nov 6, 2023
1 parent f757e8f commit f683e7e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/src/diffutil_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -558,14 +558,16 @@ class DiffResult<T> {
}
i++;
}
while (i < postponedUpdates.length) {
print("getPostponedUpdate $postponedUpdate $i ${postponedUpdates.length}");
while (i++ < postponedUpdates.length) {
// re-offset all others
final update = postponedUpdates.elementAt(i);
if (removal) {
update.currentPos--;
} else {
update.currentPos++;
}
i++;

Check warning on line 570 in lib/src/diffutil_impl.dart

View check run for this annotation

Codecov / codecov/patch

lib/src/diffutil_impl.dart#L570

Added line #L570 was not covered by tests
}
return postponedUpdate;
}
Expand Down

0 comments on commit f683e7e

Please sign in to comment.