From f683e7ecb560e45477eb16a5af8a68cb3451f4bf Mon Sep 17 00:00:00 2001 From: Martin Kamleithner Date: Mon, 6 Nov 2023 19:06:46 +0000 Subject: [PATCH] fix endless loop when re-offsetting postponed updates --- lib/src/diffutil_impl.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/diffutil_impl.dart b/lib/src/diffutil_impl.dart index 4da5bf4..9853de9 100644 --- a/lib/src/diffutil_impl.dart +++ b/lib/src/diffutil_impl.dart @@ -558,7 +558,8 @@ class DiffResult { } 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) { @@ -566,6 +567,7 @@ class DiffResult { } else { update.currentPos++; } + i++; } return postponedUpdate; }