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:
Kir Kolyshkin 2020-03-27 00:31:26 -07:00
parent 0af5cd2041
commit aab2c8ba52
1 changed files with 1 additions and 1 deletions

View File

@ -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 {