diff options
author | Rob Pike <r@golang.org> | 2009-11-18 15:24:24 -0800 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2009-11-18 15:24:24 -0800 |
commit | 391051631f6118f60751735160d4f5a4b41ba5db (patch) | |
tree | a54bad89b8447ed713d40539471ce8d1b9f811ff /src/pkg/strconv | |
parent | e97248aec165fe74b5b765813d8d8f9e44790910 (diff) | |
download | golang-391051631f6118f60751735160d4f5a4b41ba5db.tar.gz |
remove bytes.Copy
replace all calls with calls to copy
use copy in regexp and bytes.Buffer
R=rsc
CC=golang-dev
http://codereview.appspot.com/157073
Diffstat (limited to 'src/pkg/strconv')
-rw-r--r-- | src/pkg/strconv/decimal.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/pkg/strconv/decimal.go b/src/pkg/strconv/decimal.go index d39419bd9..04caedb6d 100644 --- a/src/pkg/strconv/decimal.go +++ b/src/pkg/strconv/decimal.go @@ -11,8 +11,6 @@ package strconv -import "bytes" - type decimal struct { // TODO(rsc): Can make d[] a bit smaller and add // truncated bool; @@ -43,18 +41,18 @@ func (a *decimal) String() string { buf[w] = '.'; w++; w += digitZero(buf[w : w+-a.dp]); - w += bytes.Copy(buf[w:w+a.nd], a.d[0:a.nd]); + w += copy(buf[w:w+a.nd], a.d[0:a.nd]); case a.dp < a.nd: // decimal point in middle of digits - w += bytes.Copy(buf[w:w+a.dp], a.d[0:a.dp]); + w += copy(buf[w:w+a.dp], a.d[0:a.dp]); buf[w] = '.'; w++; - w += bytes.Copy(buf[w:w+a.nd-a.dp], a.d[a.dp:a.nd]); + w += copy(buf[w:w+a.nd-a.dp], a.d[a.dp:a.nd]); default: // zeros fill space between digits and decimal point - w += bytes.Copy(buf[w:w+a.nd], a.d[0:a.nd]); + w += copy(buf[w:w+a.nd], a.d[0:a.nd]); w += digitZero(buf[w : w+a.dp-a.nd]); } return string(buf[0:w]); |