Commit 165ebaf9 authored by ludweeg's avatar ludweeg Committed by Mikio Hara

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: default avatarMikio Hara <mikioh.mikioh@gmail.com>
parent 2bb91e09
...@@ -318,9 +318,9 @@ func TestDialParallel(t *testing.T) { ...@@ -318,9 +318,9 @@ func TestDialParallel(t *testing.T) {
expectElapsedMin := tt.expectElapsed - 95*time.Millisecond expectElapsedMin := tt.expectElapsed - 95*time.Millisecond
expectElapsedMax := 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) 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) t.Errorf("#%d: got %v; want <= %v", i, elapsed, expectElapsedMax)
} }
...@@ -418,10 +418,10 @@ func TestDialerFallbackDelay(t *testing.T) { ...@@ -418,10 +418,10 @@ func TestDialerFallbackDelay(t *testing.T) {
} }
expectMin := tt.expectElapsed - 1*time.Millisecond expectMin := tt.expectElapsed - 1*time.Millisecond
expectMax := tt.expectElapsed + 95*time.Millisecond expectMax := tt.expectElapsed + 95*time.Millisecond
if !(elapsed >= expectMin) { if elapsed < expectMin {
t.Errorf("#%d: got %v; want >= %v", i, 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) t.Errorf("#%d: got %v; want <= %v", i, elapsed, expectMax)
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment