Refactor some code to use simply format

Signed-off-by: Hu Keping <hukeping@huawei.com>
This commit is contained in:
Hu Keping 2015-09-06 20:46:47 +08:00
parent 8562c423b8
commit cd33b98041
1 changed files with 2 additions and 4 deletions

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