refactor: use loops inside list literals

This commit is contained in:
Aleksey Kulikov 2022-05-25 12:08:23 +03:00
parent c35d336a56
commit 5c9c23f9f5
13 changed files with 65 additions and 106 deletions

View file

@ -47,18 +47,13 @@ class Rebase {
/// List of operations that are to be applied.
List<RebaseOperation> get operations {
final result = <RebaseOperation>[];
final operationsCount = bindings.operationsCount(_rebasePointer);
for (var i = 0; i < operationsCount; i++) {
final operation = bindings.getOperationByIndex(
rebase: _rebasePointer,
index: i,
);
result.add(RebaseOperation._(operation));
}
return result;
return <RebaseOperation>[
for (var i = 0; i < operationsCount; i++)
RebaseOperation._(
bindings.getOperationByIndex(rebase: _rebasePointer, index: i),
)
];
}
/// Index of the rebase operation that is currently being applied. If the