Commit 2f2e8f9c authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

runtime: use staticbytes in intstring for small v

Triggers 21 times during make.bash.

Change-Id: I7efb34200439256151304bb66cd309913f7c9c9e
Reviewed-on: https://go-review.googlesource.com/110557
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarMartin Möhrmann <moehrmann@google.com>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 6a8cff57
......@@ -229,8 +229,13 @@ func stringStructOf(sp *string) *stringStruct {
return (*stringStruct)(unsafe.Pointer(sp))
}
func intstring(buf *[4]byte, v int64) string {
var s string
func intstring(buf *[4]byte, v int64) (s string) {
if v >= 0 && v < runeSelf {
stringStructOf(&s).str = unsafe.Pointer(&staticbytes[v])
stringStructOf(&s).len = 1
return
}
var b []byte
if buf != nil {
b = buf[:]
......
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