]> Cypherpunks repositories - gostls13.git/commitdiff
all: omit comparison bool constant to simplify code
authorcui fliter <imcusg@gmail.com>
Fri, 30 Sep 2022 03:22:55 +0000 (03:22 +0000)
committerGopher Robot <gobot@golang.org>
Fri, 30 Sep 2022 20:09:46 +0000 (20:09 +0000)
Change-Id: Icd4062e570559f1d0c69d4bdb9e23412054cf2a6
GitHub-Last-Rev: fbbfbcb54dac88c9a8f5c5c6d210be46f87e27dd
GitHub-Pull-Request: golang/go#55958
Reviewed-on: https://go-review.googlesource.com/c/go/+/436880
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/cmd/internal/obj/arm64/asm7.go
src/runtime/mem_plan9.go
src/runtime/pprof/proto.go
src/runtime/pprof/protobuf.go
src/runtime/testdata/testprog/numcpu_freebsd.go

index 1e36985654dd3d09761f4dc0a5891cfe61dd096e..62b34e2464059d3bda6122de6822e6071680591e 100644 (file)
@@ -7450,7 +7450,7 @@ func (c *ctxt7) opldpstp(p *obj.Prog, o *Optab, vo int32, rbase, rl, rh, ldp uin
        case ALDP, ALDPW, ALDPSW:
                c.checkUnpredictable(p, true, wback, p.From.Reg, p.To.Reg, int16(p.To.Offset))
        case ASTP, ASTPW:
-               if wback == true {
+               if wback {
                        c.checkUnpredictable(p, false, true, p.To.Reg, p.From.Reg, int16(p.From.Offset))
                }
        case AFLDPD, AFLDPQ, AFLDPS:
index 0e8bf7474608f2d5302c40d40663c89ac6278232..88e7d92a7c5d9f2c332d2f35697a8a3b9b32c8e7 100644 (file)
@@ -92,7 +92,7 @@ func memFree(ap unsafe.Pointer, n uintptr) {
 }
 
 func memCheck() {
-       if memDebug == false {
+       if !memDebug {
                return
        }
        for p := memFreelist.ptr(); p != nil && p.next != 0; p = p.next.ptr() {
index 7e3c5f1c184d662d83c245ddfbe3e81593567fc9..e856c7643e91addccbfe59a39600149340776fb5 100644 (file)
@@ -230,7 +230,7 @@ func allFrames(addr uintptr) ([]runtime.Frame, symbolizeFlag) {
                frame.PC = addr - 1
        }
        ret := []runtime.Frame{frame}
-       for frame.Function != "runtime.goexit" && more == true {
+       for frame.Function != "runtime.goexit" && more {
                frame, more = frames.Next()
                ret = append(ret, frame)
        }
index 7b99095a13a62ee2eba53779934d1880c6c87e95..f7ec1ac59cb4783d3f824657f965ace713b722f4 100644 (file)
@@ -116,7 +116,7 @@ func (b *protobuf) bool(tag int, x bool) {
 }
 
 func (b *protobuf) boolOpt(tag int, x bool) {
-       if x == false {
+       if !x {
                return
        }
        b.bool(tag, x)
index 7209f67959a0a293705c36a147bd1a8be900774d..310c21244cfa5436e2a624fcf953aff971ba359c 100644 (file)
@@ -48,7 +48,7 @@ func FreeBSDNumCPU() {
                fmt.Printf("fail to launch '%s', error: %s, output: %s\n", strings.Join(cmd.Args, " "), err, output)
                return
        }
-       if bytes.Equal(output, []byte("1\n")) == false {
+       if !bytes.Equal(output, []byte("1\n")) {
                // SMP mode deactivated in kernel.
                fmt.Println("OK")
                return