Skip to content

Commit 4eba395

Browse files
committed
Map instead of reduce
1 parent 39f519b commit 4eba395

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Sources/libhostmgr/Model/RemoteVMRepository.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ public struct RemoteVMRepository {
101101
.filter { $0.key.hasSuffix(".sha256.txt") }
102102
.sorted()
103103

104-
return zip(imageObjects, checksums).reduce(into: [RemoteVMImage]()) {
105-
$0.append(RemoteVMImage(imageObject: $1.0, checksumObject: $1.1))
106-
}
104+
return zip(imageObjects, checksums)
105+
.map { RemoteVMImage(imageObject: $0, checksumObject: $1) }
107106
}
108107
}

0 commit comments

Comments
 (0)