]> Cypherpunks repositories - gostls13.git/commitdiff
time: simplify comparison in test
authorVeselkov Konstantin <kostozyb@gmail.com>
Fri, 6 Apr 2018 18:54:29 +0000 (22:54 +0400)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 6 Apr 2018 19:41:30 +0000 (19:41 +0000)
Found using go-simple.

Change-Id: I349e80a8c083688539bb4267564f02e3d7913da5
Reviewed-on: https://go-review.googlesource.com/105195
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/time/sleep_test.go

index 9af39c0d03b5c9693bdfe9770eb9a74dd3af048e..a31494d47b145217279c892bd3c481956e0a4172 100644 (file)
@@ -359,7 +359,7 @@ func TestSleepZeroDeadlock(t *testing.T) {
 func testReset(d Duration) error {
        t0 := NewTimer(2 * d)
        Sleep(d)
-       if t0.Reset(3*d) != true {
+       if !t0.Reset(3 * d) {
                return errors.New("resetting unfired timer returned false")
        }
        Sleep(2 * d)
@@ -375,7 +375,7 @@ func testReset(d Duration) error {
                return errors.New("reset timer did not fire")
        }
 
-       if t0.Reset(50*Millisecond) != false {
+       if t0.Reset(50 * Millisecond) {
                return errors.New("resetting expired timer returned true")
        }
        return nil