aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2024-04-17 13:48:28 -0600
committerNavan Chauhan <navanchauhan@gmail.com>2024-04-17 13:48:28 -0600
commit68c10ee9c00ac2fc8fb3a9c75ab131a06e85f9d2 (patch)
tree38ba43510f6ddd587e2b5243cbeab99d4b71f420
parentfe61fc78114515141eda343ebdeaa1480e06a6b5 (diff)
switch to compactMap
-rw-r--r--Tests/SwiftChessNeoTests/SwiftChessNeoTests.swift2
1 files changed, 1 insertions, 1 deletions
diff --git a/Tests/SwiftChessNeoTests/SwiftChessNeoTests.swift b/Tests/SwiftChessNeoTests/SwiftChessNeoTests.swift
index 310a53c..959d357 100644
--- a/Tests/SwiftChessNeoTests/SwiftChessNeoTests.swift
+++ b/Tests/SwiftChessNeoTests/SwiftChessNeoTests.swift
@@ -67,7 +67,7 @@ final class Sage2Tests: XCTestCase {
func testBoardSequence() {
let board = Board()
let spaces = Array(board)
- let pieces = spaces.flatMap({ $0.piece })
+ let pieces = spaces.compactMap({ $0.piece })
let whitePieces = pieces.filter({ $0.color.isWhite })
let blackPieces = pieces.filter({ $0.color.isBlack })
XCTAssertEqual(spaces.count, 64)