mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
fix: fixed swiftlint error that appears in the new version of swiftlint
This commit is contained in:
@@ -136,15 +136,12 @@ public class ProcessReader: Reader<[TopProcess]> {
|
||||
|
||||
let outputData = outputPipe.fileHandleForReading.readDataToEndOfFile()
|
||||
let errorData = errorPipe.fileHandleForReading.readDataToEndOfFile()
|
||||
let output = String(decoding: outputData, as: UTF8.self)
|
||||
_ = String(decoding: errorData, as: UTF8.self)
|
||||
|
||||
if output.isEmpty {
|
||||
return
|
||||
}
|
||||
let output = String(data: outputData, encoding: .utf8)
|
||||
_ = String(data: errorData, encoding: .utf8)
|
||||
guard let output, !output.isEmpty else { return }
|
||||
|
||||
var processes: [TopProcess] = []
|
||||
output.enumerateLines { (line, _) -> Void in
|
||||
output.enumerateLines { (line, _) in
|
||||
if line.matches("^\\d+\\** +.* +\\d+[A-Z]*\\+?\\-? *$") {
|
||||
processes.append(ProcessReader.parseProcess(line))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user