From 1bff7486034600de5d645efd6e529ec62819661c Mon Sep 17 00:00:00 2001 From: Jeffrey 'jf' Lim Date: Fri, 30 Jan 2015 12:10:17 +0800 Subject: [PATCH] blob.go: more idiomatic and clearer 'for' loop --- clients/storage/blob.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/clients/storage/blob.go b/clients/storage/blob.go index b24ad099d185..c90f9aaa661c 100644 --- a/clients/storage/blob.go +++ b/clients/storage/blob.go @@ -532,10 +532,9 @@ func (b BlobStorageClient) putBlockBlob(container, name string, blob io.Reader, } else { // Does not fit into one block. Upload block by block then commit the block list blockList := []Block{} - blockNum := 0 // Put blocks - for { + for blockNum := 0; ; blockNum++ { id := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%011d", blockNum))) data := chunk[:n] err = b.PutBlock(container, name, id, data) @@ -552,8 +551,6 @@ func (b BlobStorageClient) putBlockBlob(container, name string, blob io.Reader, if err == io.EOF { break } - - blockNum++ } // Commit block list