Skip to content

Commit

Permalink
Make pieceCount(for:) faster
Browse files Browse the repository at this point in the history
  • Loading branch information
nvzqz committed Aug 6, 2016
1 parent 701b6ff commit 563cb9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Board.swift
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ public struct Board: Hashable, CustomStringConvertible {
if let color = color {
return bitboard(for: color).count
} else {
return _bitboards.map({ $0.count }).reduce(0, combine: +)
return _bitboards.reduce(0) { $0 + $1.count }
}
}

Expand Down

0 comments on commit 563cb9e

Please sign in to comment.