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

Merge pull request #18024 from LK4D4/simple_byparent

graph/graph.go: simplify appending to slice in map in byParent
This commit is contained in:
Michael Crosby 2015-11-17 11:45:24 -08:00
commit e58b0bba7f

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
} }