             }
         }
         return result
-    }
-
-    private func groupResultsBySourceLine(results: [CMCompileMeasure]) -> [CMCompileMeasure] {
-        var grouped: [String:CMCompileMeasure] = [:]
-        for result in results {
-            let key = result.fileAndLine
-            if var measure = grouped[key] {
-                measure.time += result.time
-                grouped[key] = measure
-            } else {
-                grouped[key] = result
-            }
-        }
-        return Array(grouped.values)
     }
     
     private func trimPrefixes(code: String) -> String {


class CMLogProcessor: NSObject, CMLogProcessorProtocol {
    
    var unprocessedResult: [CMRawMeasure] = []
    var updateHandler: CMUpdateClosure?
    var workspace: CMXcodeWorkSpace?
    var shouldCancel = false

            let timeString = text.substringToIndex(text.startIndex.advancedBy(match.range.length - 4))
            if let time = Double(timeString) {
                let value = text.substringFromIndex(text.startIndex.advancedBy(match.range.length - 1))
                if var rawMeasure = rawMeasures[value] {
                    rawMeasure.time += time
                    rawMeasures[value] = rawMeasure
                } else {
                    rawMeasures[value] = CMRawMeasure(time: time, text: value)
                }
            }
            if shouldCancel {
                break
            }
        }
        processingDidFinish()
    }
    
    private func updateResults(didComplete: Bool) {
        let unprocessedResult = rawMeasures.values.filter({ $0.time > 10 }).sort({ $0.time > $1.time })
        updateHandler?(result: processResult(unprocessedResult), didComplete: didComplete)
        if didComplete {
            rawMeasures.removeAll()
        }
    }
    
    private func processResult(unprocessedResult: [CMRawMeasure]) -> [CMCompileMeasure] {
        var result: [CMCompileMeasure] = []
        for entry in unprocessedResult {
