Merge pull request #95821 from markusthoemmes/optimize-nn-string

Optimize string building for NamespacedName
This commit is contained in:
Kubernetes Prow Robot 2020-10-26 07:45:01 -07:00 committed by GitHub
commit e79a873b4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,10 +16,6 @@ limitations under the License.
package types
import (
"fmt"
)
// NamespacedName comprises a resource name, with a mandatory namespace,
// rendered as "<namespace>/<name>". Being a type captures intent and
// helps make sure that UIDs, namespaced names and non-namespaced names
@ -39,5 +35,5 @@ const (
// String returns the general purpose string representation
func (n NamespacedName) String() string {
return fmt.Sprintf("%s%c%s", n.Namespace, Separator, n.Name)
return n.Namespace + string(Separator) + n.Name
}