Refactor some code to use simply format

Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: cd33b98041385a2b96edfa7705f1d512a14d3f92
Component: engine
This commit is contained in:
Hu Keping
2015-09-06 20:59:09 +08:00
parent 22b92a13e4
commit 0d3b198734
+2 -4
View File
@@ -27,8 +27,7 @@ func (graph *Graph) WalkHistory(img *image.Image, handler func(image.Image) erro
return nil
}
// depth returns the number of parents for a
// current image
// depth returns the number of parents for the current image
func (graph *Graph) depth(img *image.Image) (int, error) {
var (
count = 0
@@ -38,8 +37,7 @@ func (graph *Graph) depth(img *image.Image) (int, error) {
for parent != nil {
count++
parent, err = graph.GetParent(parent)
if err != nil {
if parent, err = graph.GetParent(parent); err != nil {
return -1, err
}
}