mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-09-29 19:41:15 +02:00
controller(listVMs): reduce allocations (#400)
* controller(listVMs): reduce allocations * Declare an empty, non-nil slice to return [] when no objects are found
This commit is contained in:
@@ -344,7 +344,9 @@ func (controller *Controller) listVMs(ctx *gin.Context) responder.Responder {
|
||||
return responder.Code(http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
vms := make([]v1.VM, 0, len(allVMs))
|
||||
// Declare an empty, non-nil slice to
|
||||
// return [] when no objects are found
|
||||
vms := []v1.VM{}
|
||||
|
||||
Outer:
|
||||
for _, vm := range allVMs {
|
||||
|
||||
Reference in New Issue
Block a user