mirror of
https://github.com/qinyuhang/ShadowsocksX-NG-R.git
synced 2026-10-21 15:25:49 +00:00
sytanx refine
This commit is contained in:
@@ -117,7 +117,7 @@ open class NetWorkMonitor: NSObject {
|
||||
let pattern = "en\\w+\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)"
|
||||
do {
|
||||
let regex = try NSRegularExpression(pattern: pattern, options: NSRegularExpression.Options.caseInsensitive)
|
||||
let results = regex.matches(in: string, options: NSRegularExpression.MatchingOptions(rawValue: 0), range: NSMakeRange(0, string.characters.count))
|
||||
let results = regex.matches(in: string, options: NSRegularExpression.MatchingOptions(rawValue: 0), range: NSMakeRange(0, string.count))
|
||||
var upRate: Float = 0.00
|
||||
var downRate: Float = 0.00
|
||||
for result in results {
|
||||
|
||||
@@ -116,7 +116,7 @@ class PingServers:NSObject{
|
||||
return nil
|
||||
}
|
||||
res.removeSubrange(res.range(of: "round-trip min/avg/max/stddev = ")!)
|
||||
res = String(res.characters.dropLast(3))
|
||||
res = String(res.dropLast(3))
|
||||
res = res.components(separatedBy: "/")[1]
|
||||
let latency = Double(res)
|
||||
return latency
|
||||
|
||||
@@ -32,7 +32,7 @@ class ProxyPreferencesController: NSWindowController, NSTableViewDataSource, NST
|
||||
selectedNetworkServices = NSMutableSet()
|
||||
}
|
||||
|
||||
networkServices = ProxyConfTool.networkServicesList() as NSArray!
|
||||
networkServices = ProxyConfTool.networkServicesList() as NSArray
|
||||
tableView.reloadData()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user