replace some basic uses of fmt.Sprintf()
Really tiny gains here, and doesn't significantly impact readability:
BenchmarkSprintf
BenchmarkSprintf-10 11528700 91.59 ns/op 32 B/op 1 allocs/op
BenchmarkConcat
BenchmarkConcat-10 100000000 11.76 ns/op 0 B/op 0 allocs/op
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -350,7 +350,7 @@ func (c *criService) register(s *grpc.Server) error {
|
||||
// imageFSPath returns containerd image filesystem path.
|
||||
// Note that if containerd changes directory layout, we also needs to change this.
|
||||
func imageFSPath(rootDir, snapshotter string) string {
|
||||
return filepath.Join(rootDir, fmt.Sprintf("%s.%s", plugin.SnapshotPlugin, snapshotter))
|
||||
return filepath.Join(rootDir, plugin.SnapshotPlugin.String()+"."+snapshotter)
|
||||
}
|
||||
|
||||
func loadOCISpec(filename string) (*oci.Spec, error) {
|
||||
|
||||
@@ -332,7 +332,7 @@ func (c *criService) register(s *grpc.Server) error {
|
||||
// imageFSPath returns containerd image filesystem path.
|
||||
// Note that if containerd changes directory layout, we also needs to change this.
|
||||
func imageFSPath(rootDir, snapshotter string) string {
|
||||
return filepath.Join(rootDir, fmt.Sprintf("%s.%s", plugin.SnapshotPlugin, snapshotter))
|
||||
return filepath.Join(rootDir, plugin.SnapshotPlugin.String()+"."+snapshotter)
|
||||
}
|
||||
|
||||
func loadOCISpec(filename string) (*oci.Spec, error) {
|
||||
|
||||
Reference in New Issue
Block a user