Skip to content

Commit

Permalink
the code has been moved before append
Browse files Browse the repository at this point in the history
Signed-off-by: Yalcin Ozbek <yalcinozbekceng@gmail.com>
  • Loading branch information
yaozbek committed Nov 5, 2022
1 parent 4314a05 commit 8bf7f37
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cpu/cpu_linux.go
Expand Up @@ -285,10 +285,6 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) {
c.Microcode = value
}
}
if c.CPU >= 0 {
finishCPUInfo(&c)
ret = append(ret, c)
}
if c.VendorID == "ARM" && c.ModelName == "" {
if v, err := strconv.ParseUint(c.Model, 0, 16); err == nil {
modelName, exist := armModelToModelName[v]
Expand All @@ -299,6 +295,10 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) {
}
}
}
if c.CPU >= 0 {
finishCPUInfo(&c)
ret = append(ret, c)
}
return ret, nil
}

Expand Down

0 comments on commit 8bf7f37

Please sign in to comment.