Browse code

Use ++ instead of += 1

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>

Alexandr Morozov authored on 2014/08/20 21:09:54
Showing 2 changed files
... ...
@@ -127,7 +127,7 @@ func (daemon *Daemon) Attach(container *Container, stdin io.ReadCloser, stdinClo
127 127
 	)
128 128
 
129 129
 	if stdin != nil && container.Config.OpenStdin {
130
-		nJobs += 1
130
+		nJobs++
131 131
 		if cStdin, err := container.StdinPipe(); err != nil {
132 132
 			errors <- err
133 133
 		} else {
... ...
@@ -163,7 +163,7 @@ func (daemon *Daemon) Attach(container *Container, stdin io.ReadCloser, stdinClo
163 163
 		}
164 164
 	}
165 165
 	if stdout != nil {
166
-		nJobs += 1
166
+		nJobs++
167 167
 		if p, err := container.StdoutPipe(); err != nil {
168 168
 			errors <- err
169 169
 		} else {
... ...
@@ -201,7 +201,7 @@ func (daemon *Daemon) Attach(container *Container, stdin io.ReadCloser, stdinClo
201 201
 		}()
202 202
 	}
203 203
 	if stderr != nil {
204
-		nJobs += 1
204
+		nJobs++
205 205
 		if p, err := container.StderrPipe(); err != nil {
206 206
 			errors <- err
207 207
 		} else {
... ...
@@ -252,7 +252,7 @@ func (daemon *Daemon) Attach(container *Container, stdin io.ReadCloser, stdinClo
252 252
 
253 253
 		// FIXME: how to clean up the stdin goroutine without the unwanted side effect
254 254
 		// of closing the passed stdin? Add an intermediary io.Pipe?
255
-		for i := 0; i < nJobs; i += 1 {
255
+		for i := 0; i < nJobs; i++ {
256 256
 			log.Debugf("attach: waiting for job %d/%d", i+1, nJobs)
257 257
 			if err := <-errors; err != nil {
258 258
 				log.Errorf("attach: job %d returned error %s, aborting all jobs", i+1, err)
... ...
@@ -908,7 +908,7 @@ func (b *buildFile) Build(context io.Reader) (string, error) {
908 908
 		} else if b.rm {
909 909
 			b.clearTmp(b.tmpContainers)
910 910
 		}
911
-		stepN += 1
911
+		stepN++
912 912
 	}
913 913
 	if b.image != "" {
914 914
 		fmt.Fprintf(b.outStream, "Successfully built %s\n", utils.TruncateID(b.image))