Skip to content

Commit

Permalink
Use Stringbuffer to build strings
Browse files Browse the repository at this point in the history
  • Loading branch information
styrix560 committed Jul 18, 2024
1 parent 2065f6e commit 1f4bb37
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/widgets/overview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ class OverviewWidget extends HookWidget {
return a.row.compareTo(b.row);
},
);
var formattedSeats = "";
final formattedSeats = StringBuffer();
while (true) {
final nextSeats = seatList.take(5);
seatList.removeRange(0, min(5, seatList.length));
formattedSeats += nextSeats.join(" / ");
formattedSeats.write(nextSeats.join(" / "));
if (seatList.isEmpty) break;
formattedSeats += "\n";
formattedSeats.write("\n");
}
return formattedSeats;
return formattedSeats.toString();
}

@override
Expand Down

0 comments on commit 1f4bb37

Please sign in to comment.