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
@@ -77,7 +77,7 @@ class PrefsWindowController: NSWindowController, NSWindowDelegate {
window?.toolbar?.allowsUserCustomization = false
window?.toolbar?.selectedItemIdentifier = general
if let items = window?.toolbar?.items, let item = (items.filter { $0.itemIdentifier == general }).first {
if let items = window?.toolbar?.items, let item = (items.first { $0.itemIdentifier == general }) {
selectItem(item, animate: false)
}
}