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
|
@ -55,7 +55,7 @@ class Index with IterableMixin<IndexEntry> {
|
|||
final conflicts = bindings.conflictList(_indexPointer);
|
||||
var result = <String, ConflictEntry>{};
|
||||
|
||||
for (var entry in conflicts) {
|
||||
for (final entry in conflicts) {
|
||||
IndexEntry? ancestor, our, their;
|
||||
String path;
|
||||
|
||||
|
@ -190,8 +190,7 @@ class Index with IterableMixin<IndexEntry> {
|
|||
int interhunkLines = 0,
|
||||
}) {
|
||||
final repo = bindings.owner(_indexPointer);
|
||||
final int flagsInt =
|
||||
flags.fold(0, (previousValue, e) => previousValue | e.value);
|
||||
final int flagsInt = flags.fold(0, (acc, e) => acc | e.value);
|
||||
|
||||
return Diff(diff_bindings.indexToWorkdir(
|
||||
repoPointer: repo,
|
||||
|
@ -212,8 +211,7 @@ class Index with IterableMixin<IndexEntry> {
|
|||
int interhunkLines = 0,
|
||||
}) {
|
||||
final repo = bindings.owner(_indexPointer);
|
||||
final int flagsInt =
|
||||
flags.fold(0, (previousValue, e) => previousValue | e.value);
|
||||
final int flagsInt = flags.fold(0, (acc, e) => acc | e.value);
|
||||
|
||||
return Diff(diff_bindings.treeToIndex(
|
||||
repoPointer: repo,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue