From 29824ab110f7d4f2ea0e738b50df9999077859d8 Mon Sep 17 00:00:00 2001 From: Ted Yu Date: Mon, 24 Feb 2020 11:28:49 -0800 Subject: [PATCH] Simplify getNodeIdFromCpuBus --- machine/machine.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/machine/machine.go b/machine/machine.go index d4e8443c..104e24a6 100644 --- a/machine/machine.go +++ b/machine/machine.go @@ -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 } }