Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2c1e6cd

Browse files
committed
Replace deprecated flatMap() with compactMap()
1 parent 7cd10e7 commit 2c1e6cd

File tree

1 file changed

+1
-1
lines changed
  • Classic Computer Science Problems in Swift.playground/Pages/Chapter 8.xcplaygroundpage

1 file changed

+1
-1
lines changed

‎Classic Computer Science Problems in Swift.playground/Pages/Chapter 8.xcplaygroundpage/Contents.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ let phoneMapping: [Character: [Character]] = ["1": ["1"], "2": ["a", "b", "c"],
151151

152152
// return all of the possible characters combos, given a mapping, for a given number
153153
func stringToPossibilities(_ s: String, mapping: [Character: [Character]]) -> [[Character]]{
154-
let possibilities = s.flatMap{ mapping[0ドル] }
154+
let possibilities = s.compactMap{ mapping[0ドル] }
155155
print(possibilities)
156156
return combineAllPossibilities(possibilities)
157157
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /