replace some fmt.Sprintfs with strconv
Teeny-tiny optimizations:
BenchmarkSprintf-10 37735996 32.31 ns/op 0 B/op 0 allocs/op
BenchmarkItoa-10 591945836 2.031 ns/op 0 B/op 0 allocs/op
BenchmarkFormatUint-10 593701444 2.014 ns/op 0 B/op 0 allocs/op
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -151,7 +151,7 @@ func makeContainerName(c *runtime.ContainerMetadata, s *runtime.PodSandboxMetada
|
||||
s.Name, // 1: pod name
|
||||
s.Namespace, // 2: pod namespace
|
||||
s.Uid, // 3: pod uid
|
||||
strconv.FormatUint(uint64(s.Attempt), 10), // 4: attempt number of creating the container
|
||||
strconv.FormatUint(uint64(c.Attempt), 10), // 4: attempt number of creating the container
|
||||
}, nameDelimiter)
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ func makeContainerName(c *runtime.ContainerMetadata, s *runtime.PodSandboxMetada
|
||||
s.Name, // 1: pod name
|
||||
s.Namespace, // 2: pod namespace
|
||||
s.Uid, // 3: pod uid
|
||||
strconv.FormatUint(uint64(s.Attempt), 10), // 4: attempt number of creating the container
|
||||
strconv.FormatUint(uint64(c.Attempt), 10), // 4: attempt number of creating the container
|
||||
}, nameDelimiter)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user