mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-15 00:34:08 +09:00
fix: fixed swiftlint error that appears in the new version of swiftlint
This commit is contained in:
@@ -194,13 +194,11 @@ public class ProcessReader: Reader<[TopProcess]> {
|
||||
return
|
||||
}
|
||||
|
||||
let output = String(decoding: outputData.advanced(by: outputData.count/2), as: UTF8.self)
|
||||
if output.isEmpty {
|
||||
return
|
||||
}
|
||||
let output = String(data: outputData.advanced(by: outputData.count/2), 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)]*\\d+\\.*\\d* *$") {
|
||||
let str = line.trimmingCharacters(in: .whitespaces)
|
||||
let pidFind = str.findAndCrop(pattern: "^\\d+")
|
||||
|
||||
Reference in New Issue
Block a user