From 25b37e2f0481e5e71e0c9c89827823affd50dd77 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Mon, 16 Nov 2015 12:02:35 -0800 Subject: [PATCH] graph/graph.go: simplify appending to slice in map in byParent Signed-off-by: Alexander Morozov --- graph/graph.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/graph/graph.go b/graph/graph.go index 8315fbc6df..4f77f02f69 100644 --- a/graph/graph.go +++ b/graph/graph.go @@ -477,11 +477,7 @@ func (graph *Graph) ByParent() map[string][]*image.Image { if err != nil { return } - if children, exists := byParent[parent.ID]; exists { - byParent[parent.ID] = append(children, img) - } else { - byParent[parent.ID] = []*image.Image{img} - } + byParent[parent.ID] = append(byParent[parent.ID], img) }) return byParent }