mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
style: use "map/where" instead of "for" loop
This commit is contained in:
parent
3a0fa75929
commit
cfa5268af2
28 changed files with 193 additions and 323 deletions
|
@ -121,14 +121,9 @@ class RebaseOperation {
|
|||
|
||||
/// Returns the type of rebase operation.
|
||||
GitRebaseOperation get type {
|
||||
late final GitRebaseOperation result;
|
||||
for (var operation in GitRebaseOperation.values) {
|
||||
if (_rebaseOperationPointer.ref.type == operation.value) {
|
||||
result = operation;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return GitRebaseOperation.values.singleWhere(
|
||||
(e) => _rebaseOperationPointer.ref.type == e.value,
|
||||
);
|
||||
}
|
||||
|
||||
/// The commit ID being cherry-picked. This will be populated for
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue