Skip to content

Commit

Permalink
Nicer way of setting last item in list
Browse files Browse the repository at this point in the history
  • Loading branch information
amake committed Oct 12, 2024
1 parent c7526f0 commit 78085b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extension IntIterUtils on Iterable<int> {
if (acc.isEmpty || acc.last.to + 1 < idx) {
acc.add((from: idx, to: idx));
} else {
acc[acc.length - 1] = (from: acc.last.from, to: idx);
acc.last = (from: acc.last.from, to: idx);
}
return acc;
});
Expand Down

0 comments on commit 78085b5

Please sign in to comment.