libcontainer/intelrdt: optimize parseCpuInfoFile
The line we are parsing looks like this > flags : fpu vme de pse <...> so look for "flags" as a prefix, not substring. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
parent
0af5cd2041
commit
aab2c8ba52
|
@ -313,7 +313,7 @@ func parseCpuInfoFile(path string) (bool, bool, error) {
|
|||
line := s.Text()
|
||||
|
||||
// Search "cat_l3" and "mba" flags in first "flags" line
|
||||
if strings.Contains(line, "flags") {
|
||||
if strings.HasPrefix(line, "flags") {
|
||||
flags := strings.Split(line, " ")
|
||||
// "cat_l3" flag for CAT and "mba" flag for MBA
|
||||
for _, flag := range flags {
|
||||
|
|
Loading…
Reference in New Issue