Make some code more simple.
Change-Id: I801adf0dba5f6c515681345c732dbb907f945419
GitHub-Last-Rev:
a505146baca00a1b3268d11d10510afa8cea6f1d
GitHub-Pull-Request: golang/go#49626
Reviewed-on: https://go-review.googlesource.com/c/go/+/364634
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
// By doing so, we can have the input blocks (four bits each), and the key blocks (six bits each) well-aligned without
// extra shifts/rotations for alignments.
func unpack(x uint64) uint64 {
- var result uint64
-
- result = ((x>>(6*1))&0xff)<<(8*0) |
+ return ((x>>(6*1))&0xff)<<(8*0) |
((x>>(6*3))&0xff)<<(8*1) |
((x>>(6*5))&0xff)<<(8*2) |
((x>>(6*7))&0xff)<<(8*3) |
((x>>(6*2))&0xff)<<(8*5) |
((x>>(6*4))&0xff)<<(8*6) |
((x>>(6*6))&0xff)<<(8*7)
-
- return result
}
signal.Notify(appSignal, os.Interrupt)
go func() {
- select {
- case <-appSignal:
- stop()
- }
+ <-appSignal
+ stop()
}()
Ping(ctx)
p = p[4:]
}
- var typ byte
- typ = p[0] & 0x7F
+ typ := p[0] & 0x7F
s.typ = typ
p = p[1:]
p.i += len(tag)
p.tok = p.s[p.pos:p.i]
p.isTag = true
- return
}
// IsPlusBuild reports whether the line of text is a “// +build” constraint.
}
var _tanQ = [...]float64{
1.00000000000000000000e0,
- 1.36812963470692954678e4, //0x40cab8a5eeb36572
- -1.32089234440210967447e6, //0xc13427bc582abc96
- 2.50083801823357915839e7, //0x4177d98fc2ead8ef
- -5.38695755929454629881e7, //0xc189afe03cbe5a31
+ 1.36812963470692954678e4, // 0x40cab8a5eeb36572
+ -1.32089234440210967447e6, // 0xc13427bc582abc96
+ 2.50083801823357915839e7, // 0x4177d98fc2ead8ef
+ -5.38695755929454629881e7, // 0xc189afe03cbe5a31
}
// Tan returns the tangent of the radian argument x.
return "", err
}
}
- if strings.HasSuffix(host, ".") {
- // Strip trailing dot from fully qualified domain names.
- host = host[:len(host)-1]
- }
+ // Strip trailing dot from fully qualified domain names.
+ host = strings.TrimSuffix(host, ".")
encoded, err := toASCII(host)
if err != nil {
return "", err
go spc.copyToBackend(errc)
go spc.copyFromBackend(errc)
<-errc
- return
}
// switchProtocolCopier exists so goroutines proxying data back and
}
if len(docs) > len(descriptions) {
docsLoop:
- for name, _ := range docs {
+ for name := range docs {
for _, d := range descriptions {
if name == d.Name {
continue docsLoop
var first = true
Benchmark(func(b *B) {
if first && (b.startAllocs == 0 || b.startBytes == 0) {
- panic(fmt.Sprintf("ReadMemStats not called before first run"))
+ panic("ReadMemStats not called before first run")
}
first = false
})