     private func executePreheatingTasksIfNeeded() {
         self.needsToExecutePreheatingTasks = false
         var executingTaskCount = self.executingTasks.count
-        let sortedPreheatingTasks = self.preheatingTasks.values.sort { $0.tag < $1.tag }
-        for task in sortedPreheatingTasks {
+        for task in (self.preheatingTasks.values.sort { $0.tag < $1.tag }) {
             if executingTaskCount > self.configuration.maxConcurrentPreheatingTaskCount {
                 break
             }

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

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