         self.performBlock {
             self.cancelTasks(requests.flatMap {
                 return self.preheatingTasks[self.imageLoader.preheatingKeyForRequest($0)]
-                })
+            })
         }
     }
     
     public func stopPreheatingImages() {
         self.performBlock {
-            self.cancelTasks(Array(self.preheatingTasks.values))
+            self.cancelTasks(self.preheatingTasks.values)
         }
     }
     

        self.lock.unlock()
    }
    
    private func cancelTasks(tasks: [ImageTaskInternal]) {
        tasks.forEach { self.setState(.Cancelled, forTask: $0) }
    }
}

    public func invalidateAndCancel() {
        self.performBlock {
            self.imageLoader.delegate = nil
            self.cancelTasks(self.executingTasks)
            self.preheatingTasks.removeAll()
            self.configuration.dataLoader.invalidate()
            self.invalidated = true
