mirror of https://github.com/golang/go.git
Count only the runes up to the requested precision to decide where to truncate a string. Change the loop within truncate to need fewer jumps. name old time/op new time/op delta SprintfTruncateString-2 188ns ± 3% 155ns ± 3% -17.43% (p=0.000 n=20+20) Change-Id: I17ca9fc0bb8bf7648599df48e4785251bbc31e99 Reviewed-on: https://go-review.googlesource.com/20098 Reviewed-by: Rob Pike <r@golang.org> |
||
|---|---|---|
| .. | ||
| doc.go | ||
| export_test.go | ||
| fmt_test.go | ||
| format.go | ||
| print.go | ||
| scan.go | ||
| scan_test.go | ||
| stringer_test.go | ||