mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	pkg/runtime: preallocate slice in unstructured.go
To avoid slice growth when appending.
This commit is contained in:
		@@ -59,7 +59,7 @@ func (unstructuredJSONScheme) EncodeToStream(obj Object, w io.Writer, overrides
 | 
			
		||||
	case *Unstructured:
 | 
			
		||||
		return json.NewEncoder(w).Encode(t.Object)
 | 
			
		||||
	case *UnstructuredList:
 | 
			
		||||
		var items []map[string]interface{}
 | 
			
		||||
		items := make([]map[string]interface{}, 0, len(t.Items))
 | 
			
		||||
		for _, i := range t.Items {
 | 
			
		||||
			items = append(items, i.Object)
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user