mirror of https://github.com/golang/go.git
cmd/go: revert "remove unnecessary else conditions"
This reverts CL 144137. Reason for revert: The justification for the original commit was that golint said so, but golint is wrong. The code reads more clearly the original way. Change-Id: I960f286ed66fec67aabd953e7b69993f60b00bca Reviewed-on: https://go-review.googlesource.com/c/149339 Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
e51b19a993
commit
8f7173dcde
|
|
@ -312,8 +312,9 @@ func compareInt(x, y string) int {
|
|||
}
|
||||
if x < y {
|
||||
return -1
|
||||
} else {
|
||||
return +1
|
||||
}
|
||||
return +1
|
||||
}
|
||||
|
||||
func comparePrerelease(x, y string) int {
|
||||
|
|
@ -352,8 +353,9 @@ func comparePrerelease(x, y string) int {
|
|||
if ix != iy {
|
||||
if ix {
|
||||
return -1
|
||||
} else {
|
||||
return +1
|
||||
}
|
||||
return +1
|
||||
}
|
||||
if ix {
|
||||
if len(dx) < len(dy) {
|
||||
|
|
@ -365,14 +367,16 @@ func comparePrerelease(x, y string) int {
|
|||
}
|
||||
if dx < dy {
|
||||
return -1
|
||||
} else {
|
||||
return +1
|
||||
}
|
||||
return +1
|
||||
}
|
||||
}
|
||||
if x == "" {
|
||||
return -1
|
||||
} else {
|
||||
return +1
|
||||
}
|
||||
return +1
|
||||
}
|
||||
|
||||
func nextIdent(x string) (dx, rest string) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue