Commit 02952ad7 authored by isharipo's avatar isharipo Committed by Brad Fitzpatrick

math/big: remove "else" from if with block that ends with return

That "else" was needed due to gc DCE limitations.
Now it's not the case and we can avoid go lint complaints.
(See #23521 and https://golang.org/cl/91056.)

There is inlining test for bigEndianWord, so if test
is passing, no performance regression should occur.

Change-Id: Id84d63f361e5e51a52293904ff042966c83c16e9
Reviewed-on: https://go-review.googlesource.com/104555Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
parent 00c8e149
...@@ -1245,9 +1245,8 @@ func (z nat) bytes(buf []byte) (i int) { ...@@ -1245,9 +1245,8 @@ func (z nat) bytes(buf []byte) (i int) {
func bigEndianWord(buf []byte) Word { func bigEndianWord(buf []byte) Word {
if _W == 64 { if _W == 64 {
return Word(binary.BigEndian.Uint64(buf)) return Word(binary.BigEndian.Uint64(buf))
} else { // Explicit else is required to get inlining. See #23521
return Word(binary.BigEndian.Uint32(buf))
} }
return Word(binary.BigEndian.Uint32(buf))
} }
// setBytes interprets buf as the bytes of a big-endian unsigned // setBytes interprets buf as the bytes of a big-endian unsigned
......
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