Skip to content

Commit

Permalink
iterate over updated range
Browse files Browse the repository at this point in the history
  • Loading branch information
LoayGhreeb committed Jul 26, 2024
1 parent 55d36a3 commit 05c7c39
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/com/tobiasdiez/easybind/MappedBackedList.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ protected void sourceChanged(ListChangeListener.Change<? extends F> change) {
}
nextPermutation(from, to, permutation);
} else if (change.wasUpdated()) {
if (mapOnUpdate) {
backingList.set(change.getFrom(), mapper.apply(getSource().get(change.getFrom())));
for (int i = change.getFrom(); i < change.getTo(); i++) {
if (mapOnUpdate) {
backingList.set(i, mapper.apply(getSource().get(i)));
}
nextUpdate(i);
}
nextUpdate(change.getFrom());
} else {
if (change.wasRemoved()) {
int removePosition = change.getFrom();
Expand Down

0 comments on commit 05c7c39

Please sign in to comment.