Skip to content

Commit 3e911ed

Browse files
Merge pull request krzyzanowskim#764 from valeriyvan/reduce
Uses `reduce(into:,_)` instead of reduce(_,_)`
2 parents 1755bd0 + 165e8b0 commit 3e911ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/CryptoSwift/SHA3.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ extension SHA3: Updatable {
275275
self.accumulated.removeFirst(processedBytes)
276276

277277
// TODO: verify performance, reduce vs for..in
278-
let result = self.accumulatedHash.reduce(Array<UInt8>()) { (result, value) -> Array<UInt8> in
279-
result + value.bigEndian.bytes()
278+
let result = self.accumulatedHash.reduce(into: Array<UInt8>()) { (result, value) in
279+
result += value.bigEndian.bytes()
280280
}
281281

282282
// reset hash value for instance

0 commit comments

Comments
 (0)