mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
Extremely minor fix to ByteBuffer.
R=r APPROVED=r DELTA=1 (0 added, 0 deleted, 1 changed) OCL=27123 CL=27130
This commit is contained in:
parent
7b77851275
commit
0ea0919534
1 changed files with 1 additions and 1 deletions
|
|
@ -47,7 +47,7 @@ func (b *ByteBuffer) Write(p []byte) (n int, err *os.Error) {
|
||||||
b.buf = make([]byte, b.cap);
|
b.buf = make([]byte, b.cap);
|
||||||
b.len = 0;
|
b.len = 0;
|
||||||
}
|
}
|
||||||
if b.len + len(p) > b.cap {
|
if b.len + plen > b.cap {
|
||||||
b.cap = 2*(b.cap + plen);
|
b.cap = 2*(b.cap + plen);
|
||||||
nb := make([]byte, b.cap);
|
nb := make([]byte, b.cap);
|
||||||
bytecopy(nb, 0, b.buf, 0, b.len);
|
bytecopy(nb, 0, b.buf, 0, b.len);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue