pkg/cri: 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:
@@ -18,7 +18,6 @@ package server
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
imagespec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
@@ -147,9 +146,8 @@ func snapshotterOpts(snapshotterName string, config *runtime.ContainerConfig) ([
|
||||
case "windows":
|
||||
rootfsSize := config.GetWindows().GetResources().GetRootfsSizeInBytes()
|
||||
if rootfsSize != 0 {
|
||||
sizeStr := fmt.Sprintf("%d", rootfsSize)
|
||||
labels := map[string]string{
|
||||
"containerd.io/snapshot/windows/rootfs.sizebytes": sizeStr,
|
||||
"containerd.io/snapshot/windows/rootfs.sizebytes": strconv.FormatInt(rootfsSize, 10),
|
||||
}
|
||||
opts = append(opts, snapshots.WithLabels(labels))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user