Replace firstElementPassingTest with first(where).

This commit is contained in:
Brent Simmons
2020-05-27 22:15:19 -07:00
parent 56f597735a
commit 1e4a8a86ec

View File

@@ -53,7 +53,7 @@ final class SingleLineTextFieldSizer {
// that members of such a dictionary were mutated after insertion.
// We use just an array of sizers now which is totally fine,
// because theres only going to be like three of them.
if let cachedSizer = sizers.firstElementPassingTest({ $0.font == font }) {
if let cachedSizer = sizers.first(where: { $0.font == font }) {
return cachedSizer
}