OSDN Git Service

ArrayをSetに変更
[kcd/KCD.git] / KCD / IgnoreCommand.swift
index f5130c1..11cda4c 100644 (file)
@@ -10,7 +10,7 @@ import Cocoa
 
 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 {
@@ -18,13 +18,19 @@ final class IgnoreCommand: JSONCommand {
                 fatalError("Can not read IgnoreCommand.plist")
         }
         
-        return array
+        return Set(array)
     }()
     
     override class func canExecuteAPI(_ api: API) -> Bool {
         
-        if api.includs(in: ignores) { return true }
-        if api.isRanking() { return true }
+        if api.includs(in: ignores) {
+            
+            return true
+        }
+        if api.isRanking() {
+            
+            return true
+        }
         
         return false
     }