preallocated slices (#917)
This commit is contained in:
		
				
					committed by
					
						 Asim Aslam
						Asim Aslam
					
				
			
			
				
	
			
			
			
						parent
						
							4a694c9d02
						
					
				
				
					commit
					f67c5e779f
				
			| @@ -38,7 +38,7 @@ func (c *etcd) Read() (*source.ChangeSet, error) { | ||||
| 		return nil, fmt.Errorf("source not found: %s", c.prefix) | ||||
| 	} | ||||
|  | ||||
| 	var kvs []*mvccpb.KeyValue | ||||
| 	kvs := make([]*mvccpb.KeyValue, 0, len(rsp.Kvs)) | ||||
| 	for _, v := range rsp.Kvs { | ||||
| 		kvs = append(kvs, (*mvccpb.KeyValue)(v)) | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user