Merge pull request #2398 from tedyu/machine-node

Simplify getNodeIdFromCpuBus
This commit is contained in:
David Ashpole 2020-02-28 12:21:19 -08:00 committed by GitHub
commit d93f46f09d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,23 +170,13 @@ func getNodeIdFromCpuBus(cpuBusPath string, threadId int) (int, error) {
for _, file := range files {
filename := file.Name()
isNode, error := regexp.MatchString("^node([0-9]+)$", filename)
if error != nil {
continue
}
if !isNode {
continue
}
ok, val, _ := extractValue(filename, nodeBusRegExp)
if err != nil {
continue
}
if ok {
if val < 0 {
continue
}
nodeId = val
break
}
}