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
|
@ -196,14 +196,9 @@ class ConfigEntry {
|
|||
|
||||
/// Returns which config file this was found in.
|
||||
GitConfigLevel get level {
|
||||
late GitConfigLevel result;
|
||||
for (var level in GitConfigLevel.values) {
|
||||
if (_configEntryPointer.ref.level == level.value) {
|
||||
result = level;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return GitConfigLevel.values.singleWhere(
|
||||
(e) => _configEntryPointer.ref.level == e.value,
|
||||
);
|
||||
}
|
||||
|
||||
/// Releases memory allocated for config entry object.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue