refactor: use loops inside list literals (#60)

This commit is contained in:
Aleksey Kulikov 2022-05-25 12:16:40 +03:00 committed by GitHub
parent c35d336a56
commit ae2aef5e2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 65 additions and 106 deletions

View file

@ -211,20 +211,16 @@ class Remote extends Equatable {
final refs = bindings.lsRemotes(_remotePointer);
bindings.disconnect(_remotePointer);
final result = <RemoteReference>[];
for (final ref in refs) {
result.add(
return <RemoteReference>[
for (final ref in refs)
RemoteReference._(
isLocal: ref['local']! as bool,
localId: ref['loid'] as Oid?,
name: ref['name']! as String,
oid: ref['oid']! as Oid,
symRef: ref['symref']! as String,
),
);
}
return result;
)
];
}
/// Downloads new data and updates tips.