diff options
| author | Russ Cox <rsc@golang.org> | 2010-05-27 14:51:47 -0700 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2010-05-27 14:51:47 -0700 |
| commit | 72aaa4ca27df8cf19707c1b5b4795be22dbe2260 (patch) | |
| tree | 0a1979ffe528bfde23ecdc7ef0339d7d0a7d1a80 /src/pkg/bytes/buffer.go | |
| parent | 9ead4aa791e9113b87c9ddbde498290d1e5e4b22 (diff) | |
| download | golang-72aaa4ca27df8cf19707c1b5b4795be22dbe2260.tar.gz | |
changes &x -> x[0:] for array to slice conversion
R=gri
CC=golang-dev
http://codereview.appspot.com/1326042
Diffstat (limited to 'src/pkg/bytes/buffer.go')
| -rw-r--r-- | src/pkg/bytes/buffer.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/bytes/buffer.go b/src/pkg/bytes/buffer.go index 7a996c4ca..32571d8d8 100644 --- a/src/pkg/bytes/buffer.go +++ b/src/pkg/bytes/buffer.go @@ -74,7 +74,7 @@ func (b *Buffer) grow(n int) int { if len(b.buf)+n > cap(b.buf) { var buf []byte if b.buf == nil && n <= len(b.bootstrap) { - buf = &b.bootstrap + buf = b.bootstrap[0:] } else { // not enough space anywhere buf = make([]byte, 2*cap(b.buf)+n) @@ -181,7 +181,7 @@ func (b *Buffer) WriteRune(r int) (n int, err os.Error) { b.WriteByte(byte(r)) return 1, nil } - n = utf8.EncodeRune(r, &b.runeBytes) + n = utf8.EncodeRune(r, b.runeBytes[0:]) b.Write(b.runeBytes[0:n]) return n, nil } |
