From cd33b98041385a2b96edfa7705f1d512a14d3f92 Mon Sep 17 00:00:00 2001 From: Hu Keping Date: Sun, 6 Sep 2015 20:46:47 +0800 Subject: [PATCH] Refactor some code to use simply format Signed-off-by: Hu Keping --- graph/history.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/graph/history.go b/graph/history.go index ab072d7296..e0f3627a35 100644 --- a/graph/history.go +++ b/graph/history.go @@ -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 } }