mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Minor improvement for memory allocations
This commit is contained in:
@@ -52,7 +52,9 @@ func GetChainLines(table Table, save []byte) map[Chain]string {
|
||||
} else if strings.HasPrefix(line, "#") {
|
||||
continue
|
||||
} else if strings.HasPrefix(line, ":") && len(line) > 1 {
|
||||
chain := Chain(strings.SplitN(line[1:], " ", 2)[0])
|
||||
// We assume that the <line> contains space - chain lines have 3 fields,
|
||||
// space delimited. If there is no space, this line will panic.
|
||||
chain := Chain(line[1:strings.Index(line, " ")])
|
||||
chainsMap[chain] = line
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user