Skip to content

Commit ef729fc

Browse files
committed
reduce -> reduce(into:)
1 parent e760934 commit ef729fc

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

Sources/lib/GameFinder.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,14 @@ actor GameFinder {
5050
}
5151

5252
private static var tileSizes: Dictionary<Int, Array<Int>> {
53-
validWordLengths.reduce([:]) { dict, wordLength in
54-
var dict = dict
53+
validWordLengths.reduce(into: [:]) { dict, wordLength in
5554
dict[wordLength] = Array(repeating: minCharactersPerTile, count: numTilesPerFourtile)
5655
while dict[wordLength]!.reduce(0, +) < wordLength {
5756
guard let index = dict[wordLength]!.firstIndex(where: { $0 < maxCharactersPerTile }) else {
5857
fatalError("Couldn’t generate tileSizes")
5958
}
6059
dict[wordLength]![index] += 1
6160
}
62-
63-
return dict
6461
}
6562
}
6663

0 commit comments

Comments
 (0)