1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

graph/graph.go: simplify appending to slice in map in byParent

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
Alexander Morozov 2015-11-16 12:02:35 -08:00
parent a3065fa48f
commit 25b37e2f04

View file

@ -477,11 +477,7 @@ func (graph *Graph) ByParent() map[string][]*image.Image {
if err != nil { if err != nil {
return return
} }
if children, exists := byParent[parent.ID]; exists { byParent[parent.ID] = append(byParent[parent.ID], img)
byParent[parent.ID] = append(children, img)
} else {
byParent[parent.ID] = []*image.Image{img}
}
}) })
return byParent return byParent
} }