浏览代码

Use ++ instead of += 1

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Alexandr Morozov 11 年之前
父节点
当前提交
1ba15b8aca
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 4 4
      daemon/attach.go
  2. 1 1
      daemon/build.go

+ 4 - 4
daemon/attach.go

@@ -127,7 +127,7 @@ func (daemon *Daemon) Attach(container *Container, stdin io.ReadCloser, stdinClo
 	)
 
 	if stdin != nil && container.Config.OpenStdin {
-		nJobs += 1
+		nJobs++
 		if cStdin, err := container.StdinPipe(); err != nil {
 			errors <- err
 		} else {
@@ -163,7 +163,7 @@ func (daemon *Daemon) Attach(container *Container, stdin io.ReadCloser, stdinClo
 		}
 	}
 	if stdout != nil {
-		nJobs += 1
+		nJobs++
 		if p, err := container.StdoutPipe(); err != nil {
 			errors <- err
 		} else {
@@ -201,7 +201,7 @@ func (daemon *Daemon) Attach(container *Container, stdin io.ReadCloser, stdinClo
 		}()
 	}
 	if stderr != nil {
-		nJobs += 1
+		nJobs++
 		if p, err := container.StderrPipe(); err != nil {
 			errors <- err
 		} else {
@@ -252,7 +252,7 @@ func (daemon *Daemon) Attach(container *Container, stdin io.ReadCloser, stdinClo
 
 		// FIXME: how to clean up the stdin goroutine without the unwanted side effect
 		// of closing the passed stdin? Add an intermediary io.Pipe?
-		for i := 0; i < nJobs; i += 1 {
+		for i := 0; i < nJobs; i++ {
 			log.Debugf("attach: waiting for job %d/%d", i+1, nJobs)
 			if err := <-errors; err != nil {
 				log.Errorf("attach: job %d returned error %s, aborting all jobs", i+1, err)

+ 1 - 1
daemon/build.go

@@ -908,7 +908,7 @@ func (b *buildFile) Build(context io.Reader) (string, error) {
 		} else if b.rm {
 			b.clearTmp(b.tmpContainers)
 		}
-		stepN += 1
+		stepN++
 	}
 	if b.image != "" {
 		fmt.Fprintf(b.outStream, "Successfully built %s\n", utils.TruncateID(b.image))