mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-18 23:45:11 +00:00
Remove runtime.Typer, reduce to ObjectKinds(1) (3)
Remove the unnecessary variants, which avoids allocations in several core paths.
This commit is contained in:
@@ -32,8 +32,8 @@ func TestRecognizer(t *testing.T) {
|
||||
s := runtime.NewScheme()
|
||||
s.AddKnownTypes(unversioned.GroupVersion{Version: "v1"}, &A{})
|
||||
d := NewDecoder(
|
||||
json.NewSerializer(json.DefaultMetaFactory, s, runtime.ObjectTyperToTyper(s), false),
|
||||
json.NewYAMLSerializer(json.DefaultMetaFactory, s, runtime.ObjectTyperToTyper(s)),
|
||||
json.NewSerializer(json.DefaultMetaFactory, s, s, false),
|
||||
json.NewYAMLSerializer(json.DefaultMetaFactory, s, s),
|
||||
)
|
||||
out, _, err := d.Decode([]byte(`
|
||||
kind: A
|
||||
|
||||
Reference in New Issue
Block a user