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:
parent
a3065fa48f
commit
25b37e2f04
1 changed files with 1 additions and 5 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue