preallocated slices (#917)
This commit is contained in:
		
				
					committed by
					
						 Asim Aslam
						Asim Aslam
					
				
			
			
				
	
			
			
			
						parent
						
							4a694c9d02
						
					
				
				
					commit
					f67c5e779f
				
			| @@ -194,7 +194,7 @@ func (t *table) Query(q ...QueryOption) ([]Route, error) { | ||||
| 		return findRoutes(t.routes[opts.Service], opts.Address, opts.Gateway, opts.Network, opts.Router), nil | ||||
| 	} | ||||
|  | ||||
| 	var results []Route | ||||
| 	results := make([]Route, 0, len(t.routes)) | ||||
| 	// search through all destinations | ||||
| 	for _, routes := range t.routes { | ||||
| 		results = append(results, findRoutes(routes, opts.Address, opts.Gateway, opts.Network, opts.Router)...) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user