1
0
mirror of https://github.com/golang/go synced 2024-11-17 10:54:50 -07:00

net: simplify bool expression

Simplify `!(x <= y)` to `x > y` and `!(x >= y)` to `x < y` where x,y are not defined as float.

Change-Id: Id1e5b518395d97e75f96aa4ac5d6c0ee990c0e7d
Reviewed-on: https://go-review.googlesource.com/c/140337
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
This commit is contained in:
ludweeg 2018-10-06 18:38:37 +03:00 committed by Mikio Hara
parent 2bb91e093c
commit 165ebaf97b

View File

@ -318,9 +318,9 @@ func TestDialParallel(t *testing.T) {
expectElapsedMin := tt.expectElapsed - 95*time.Millisecond
expectElapsedMax := tt.expectElapsed + 95*time.Millisecond
if !(elapsed >= expectElapsedMin) {
if elapsed < expectElapsedMin {
t.Errorf("#%d: got %v; want >= %v", i, elapsed, expectElapsedMin)
} else if !(elapsed <= expectElapsedMax) {
} else if elapsed > expectElapsedMax {
t.Errorf("#%d: got %v; want <= %v", i, elapsed, expectElapsedMax)
}
@ -418,10 +418,10 @@ func TestDialerFallbackDelay(t *testing.T) {
}
expectMin := tt.expectElapsed - 1*time.Millisecond
expectMax := tt.expectElapsed + 95*time.Millisecond
if !(elapsed >= expectMin) {
if elapsed < expectMin {
t.Errorf("#%d: got %v; want >= %v", i, elapsed, expectMin)
}
if !(elapsed <= expectMax) {
if elapsed > expectMax {
t.Errorf("#%d: got %v; want <= %v", i, elapsed, expectMax)
}
}