Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly account for modified rows that shifted in the current delta #1564

Merged
merged 1 commit into from
Nov 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,11 @@ public MergeResults merge(DeltaUpdates updates) {
}
}

for (Iterator<Integer> it = updated.modified.iterator(); it.hasNext();) {
int ii = it.next();
updated.added.remove(ii);
updated.removed.remove(ii);
}
// exclude added items from being marked as modified, since we're hiding shifts from api consumers
updated.modified.removeAll(updated.added);

// Any position which was both added and removed should instead be marked as modified, this cleans
// up anything excluded above that didn't otherwise make sense
for (Iterator<Integer> it = updated.removed.iterator(); it.hasNext();) {
int ii = it.next();
if (updated.added.remove(ii)) {
Expand Down