From 0285e383a6949153632e914824ecec2747c541fd Mon Sep 17 00:00:00 2001 From: masakih Date: Mon, 13 Aug 2018 17:00:52 +0900 Subject: [PATCH] =?utf8?q?Array=E3=82=92Set=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit containsを多用するため --- KCD/API.swift | 2 +- KCD/IgnoreCommand.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/KCD/API.swift b/KCD/API.swift index 25300da0..0a27418d 100644 --- a/KCD/API.swift +++ b/KCD/API.swift @@ -204,7 +204,7 @@ struct API { } } - func includs(in rawValues: [String]) -> Bool { + func includs(in rawValues: Set) -> Bool { return rawValues.contains(endpointString) } diff --git a/KCD/IgnoreCommand.swift b/KCD/IgnoreCommand.swift index 799cb9ed..11cda4cb 100644 --- a/KCD/IgnoreCommand.swift +++ b/KCD/IgnoreCommand.swift @@ -10,7 +10,7 @@ import Cocoa final class IgnoreCommand: JSONCommand { - private static let ignores: [String] = { + private static let ignores: Set = { guard let url = Bundle.main.url(forResource: "IgnoreCommand", withExtension: "plist"), let array = NSArray(contentsOf: url) as? [String] else { @@ -18,7 +18,7 @@ final class IgnoreCommand: JSONCommand { fatalError("Can not read IgnoreCommand.plist") } - return array + return Set(array) }() override class func canExecuteAPI(_ api: API) -> Bool { -- 2.11.0