OSDN Git Service

ArrayをSetに変更
authormasakih <masakih@users.sourceforge.jp>
Mon, 13 Aug 2018 08:00:52 +0000 (17:00 +0900)
committermasakih <masakih@users.sourceforge.jp>
Mon, 13 Aug 2018 08:00:52 +0000 (17:00 +0900)
containsを多用するため

KCD/API.swift
KCD/IgnoreCommand.swift

index 25300da..0a27418 100644 (file)
@@ -204,7 +204,7 @@ struct API {
         }
     }
     
         }
     }
     
-    func includs(in rawValues: [String]) -> Bool {
+    func includs(in rawValues: Set<String>) -> Bool {
         
         return rawValues.contains(endpointString)
     }
         
         return rawValues.contains(endpointString)
     }
index 799cb9e..11cda4c 100644 (file)
@@ -10,7 +10,7 @@ import Cocoa
 
 final class IgnoreCommand: JSONCommand {
     
 
 final class IgnoreCommand: JSONCommand {
     
-    private static let ignores: [String] = {
+    private static let ignores: Set<String> = {
         
         guard let url = Bundle.main.url(forResource: "IgnoreCommand", withExtension: "plist"),
             let array = NSArray(contentsOf: url) as? [String] else {
         
         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")
         }
         
                 fatalError("Can not read IgnoreCommand.plist")
         }
         
-        return array
+        return Set(array)
     }()
     
     override class func canExecuteAPI(_ api: API) -> Bool {
     }()
     
     override class func canExecuteAPI(_ api: API) -> Bool {