feat: Use min for easier to read
This commit is contained in:
@@ -39,8 +39,7 @@ mixin BatchGetLabelProcessingMixin on HandleSetErrorMixin, SessionMixin {
|
|||||||
State? latestState;
|
State? latestState;
|
||||||
|
|
||||||
for (int start = 0; start < totalLabels; start += batchSize) {
|
for (int start = 0; start < totalLabels; start += batchSize) {
|
||||||
int end =
|
int end = min(start + batchSize, totalLabels);
|
||||||
(start + batchSize < totalLabels) ? start + batchSize : totalLabels;
|
|
||||||
final currentListIds = labelIds.sublist(start, end);
|
final currentListIds = labelIds.sublist(start, end);
|
||||||
|
|
||||||
log('BatchGetLabelProcessingMixin::$debugLabel: processing batch ${start + 1} to $end');
|
log('BatchGetLabelProcessingMixin::$debugLabel: processing batch ${start + 1} to $end');
|
||||||
|
|||||||
Reference in New Issue
Block a user