mirror of
https://github.com/tailscale/tailscale.git
synced 2025-05-06 07:37:38 +00:00
wgengine: remove a tiny allocation
Drop in the bucket compared to the larger issues, but noticed it when looking at pprof.
This commit is contained in:
parent
59800138ff
commit
0f64d7f9cc
@ -481,11 +481,9 @@ func (e *userspaceEngine) getStatus() (*Status, error) {
|
|||||||
var hst1, hst2, n int64
|
var hst1, hst2, n int64
|
||||||
var err error
|
var err error
|
||||||
for _, line := range lines {
|
for _, line := range lines {
|
||||||
kv := strings.SplitN(line, "=", 2)
|
k, v := line, ""
|
||||||
var k, v string
|
if i := strings.IndexByte(line, '='); i != -1 {
|
||||||
k = kv[0]
|
k, v = line[:i], line[i+1:]
|
||||||
if len(kv) > 1 {
|
|
||||||
v = kv[1]
|
|
||||||
}
|
}
|
||||||
switch k {
|
switch k {
|
||||||
case "public_key":
|
case "public_key":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user