style: use += 1 instead of ++
This commit is contained in:
parent
5fd7c19783
commit
59bbd98a58
|
@ -25,7 +25,7 @@ func (e *Sandbox) Run(cmds []stage.Cmd) ([]stage.ExecutorResult, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// cannot use range loop since we need to change the value
|
// cannot use range loop since we need to change the value
|
||||||
for i := 0; i < len(cmds); i++ {
|
for i := 0; i < len(cmds); i += 1 {
|
||||||
cmd := &cmds[i]
|
cmd := &cmds[i]
|
||||||
if cmd.CopyIn == nil {
|
if cmd.CopyIn == nil {
|
||||||
cmd.CopyIn = make(map[string]stage.CmdFile)
|
cmd.CopyIn = make(map[string]stage.CmdFile)
|
||||||
|
|
|
@ -136,14 +136,14 @@ func myersDiff(src, dst []string) []operation {
|
||||||
var x, y int
|
var x, y int
|
||||||
|
|
||||||
loop:
|
loop:
|
||||||
for d := 0; d <= max; d++ {
|
for d := 0; d <= max; d += 1 {
|
||||||
v := make(map[int]int, d+2)
|
v := make(map[int]int, d+2)
|
||||||
trace = append(trace, v)
|
trace = append(trace, v)
|
||||||
|
|
||||||
if d == 0 {
|
if d == 0 {
|
||||||
t := 0
|
t := 0
|
||||||
for len(src) > t && len(dst) > t && src[t] == dst[t] {
|
for len(src) > t && len(dst) > t && src[t] == dst[t] {
|
||||||
t++
|
t += 1
|
||||||
}
|
}
|
||||||
v[0] = t
|
v[0] = t
|
||||||
if t == len(src) && len(src) == len(dst) {
|
if t == len(src) && len(src) == len(dst) {
|
||||||
|
@ -180,7 +180,7 @@ loop:
|
||||||
y = m
|
y = m
|
||||||
var k, prevK, prevX, prevY int
|
var k, prevK, prevX, prevY int
|
||||||
|
|
||||||
for d := len(trace) - 1; d > 0; d-- {
|
for d := len(trace) - 1; d > 0; d -= 1 {
|
||||||
k = x - y
|
k = x - y
|
||||||
lastV := trace[d-1]
|
lastV := trace[d-1]
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ loop:
|
||||||
}
|
}
|
||||||
|
|
||||||
if trace[0][0] != 0 {
|
if trace[0][0] != 0 {
|
||||||
for i := 0; i < trace[0][0]; i++ {
|
for i := 0; i < trace[0][0]; i += 1 {
|
||||||
script = append(script, MOVE)
|
script = append(script, MOVE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user