Use first(where:) instead of filter().first

This commit is contained in:
Damiano Galassi committed 2020-02-04 14:03:30 +01:00
1 parent 6c29faf8f4
commit 93e82651ea
6 files changed
+11 -14

No files matched your search

+1 -1
View File
@@ -266,7 +266,7 @@ public struct iTunesStore: MetadataService {
}()
init?(language: String) {
guard let store = Store.stores.filter({ "\($0.country) (\($0.language))" == language }).first else { return nil }
guard let store = Store.stores.first(where :{ "\($0.country) (\($0.language))" == language }) else { return nil }
self.storeCode = store.storeCode
self.country3 = store.country3
self.country2 = store.country2