mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 12:49:08 -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
|
@ -109,15 +109,8 @@ class OdbObject {
|
|||
|
||||
/// Returns the type of an ODB object.
|
||||
GitObject get type {
|
||||
late GitObject result;
|
||||
final typeInt = bindings.objectType(_odbObjectPointer);
|
||||
for (var type in GitObject.values) {
|
||||
if (typeInt == type.value) {
|
||||
result = type;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return GitObject.values.singleWhere((e) => typeInt == e.value);
|
||||
}
|
||||
|
||||
/// Returns the data of an ODB object.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue