From 1d357b334f9a12a117ef72d76afc2f5c2693e68c Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Tue, 28 Feb 2017 10:37:28 -0500 Subject: [PATCH] volumes: simplify append-to-slice code --- .../volume/attachdetach/cache/actual_state_of_world.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/controller/volume/attachdetach/cache/actual_state_of_world.go b/pkg/controller/volume/attachdetach/cache/actual_state_of_world.go index 5387bec0d9d..8ef42fa7197 100644 --- a/pkg/controller/volume/attachdetach/cache/actual_state_of_world.go +++ b/pkg/controller/volume/attachdetach/cache/actual_state_of_world.go @@ -557,10 +557,7 @@ func (asw *actualStateOfWorld) GetAttachedVolumesPerNode() map[types.NodeName][] attachedVolumesPerNode := make(map[types.NodeName][]operationexecutor.AttachedVolume) for _, volumeObj := range asw.attachedVolumes { for nodeName, nodeObj := range volumeObj.nodesAttachedTo { - volumes, exists := attachedVolumesPerNode[nodeName] - if !exists { - volumes = []operationexecutor.AttachedVolume{} - } + volumes := attachedVolumesPerNode[nodeName] volumes = append(volumes, getAttachedVolume(&volumeObj, &nodeObj).AttachedVolume) attachedVolumesPerNode[nodeName] = volumes }