mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Optimize string building for NamespacedName
This commit is contained in:
parent
ededd08ba1
commit
668d560618
@ -16,10 +16,6 @@ limitations under the License.
|
|||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
)
|
|
||||||
|
|
||||||
// NamespacedName comprises a resource name, with a mandatory namespace,
|
// NamespacedName comprises a resource name, with a mandatory namespace,
|
||||||
// rendered as "<namespace>/<name>". Being a type captures intent and
|
// rendered as "<namespace>/<name>". Being a type captures intent and
|
||||||
// helps make sure that UIDs, namespaced names and non-namespaced names
|
// helps make sure that UIDs, namespaced names and non-namespaced names
|
||||||
@ -39,5 +35,5 @@ const (
|
|||||||
|
|
||||||
// String returns the general purpose string representation
|
// String returns the general purpose string representation
|
||||||
func (n NamespacedName) String() string {
|
func (n NamespacedName) String() string {
|
||||||
return fmt.Sprintf("%s%c%s", n.Namespace, Separator, n.Name)
|
return n.Namespace + string(Separator) + n.Name
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user