summaryrefslogtreecommitdiff
path: root/src/pkg/encoding
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/encoding')
-rw-r--r--src/pkg/encoding/ascii85/ascii85.go5
-rw-r--r--src/pkg/encoding/base64/base64.go5
-rw-r--r--src/pkg/encoding/git85/git.go4
3 files changed, 6 insertions, 8 deletions
diff --git a/src/pkg/encoding/ascii85/ascii85.go b/src/pkg/encoding/ascii85/ascii85.go
index 7f6be9a15..ba70f3dea 100644
--- a/src/pkg/encoding/ascii85/ascii85.go
+++ b/src/pkg/encoding/ascii85/ascii85.go
@@ -7,7 +7,6 @@
package ascii85
import (
- "bytes";
"io";
"os";
"strconv";
@@ -268,7 +267,7 @@ func (d *decoder) Read(p []byte) (n int, err os.Error) {
for {
// Copy leftover output from last decode.
if len(d.out) > 0 {
- n = bytes.Copy(p, d.out);
+ n = copy(p, d.out);
d.out = d.out[n:len(d.out)];
return;
}
@@ -279,7 +278,7 @@ func (d *decoder) Read(p []byte) (n int, err os.Error) {
ndst, nsrc, d.err = Decode(&d.outbuf, d.buf[0:d.nbuf], d.readErr != nil);
if ndst > 0 {
d.out = d.outbuf[0:ndst];
- d.nbuf = bytes.Copy(&d.buf, d.buf[nsrc:d.nbuf]);
+ d.nbuf = copy(&d.buf, d.buf[nsrc:d.nbuf]);
continue; // copy out and return
}
}
diff --git a/src/pkg/encoding/base64/base64.go b/src/pkg/encoding/base64/base64.go
index b0f57f602..b149a6715 100644
--- a/src/pkg/encoding/base64/base64.go
+++ b/src/pkg/encoding/base64/base64.go
@@ -6,7 +6,6 @@
package base64
import (
- "bytes";
"io";
"os";
"strconv";
@@ -279,7 +278,7 @@ func (d *decoder) Read(p []byte) (n int, err os.Error) {
// Use leftover decoded output from last read.
if len(d.out) > 0 {
- n = bytes.Copy(p, d.out);
+ n = copy(p, d.out);
d.out = d.out[n:len(d.out)];
return n, nil;
}
@@ -304,7 +303,7 @@ func (d *decoder) Read(p []byte) (n int, err os.Error) {
if nw > len(p) {
nw, d.end, d.err = d.enc.decode(&d.outbuf, d.buf[0:nr]);
d.out = d.outbuf[0:nw];
- n = bytes.Copy(p, d.out);
+ n = copy(p, d.out);
d.out = d.out[n:len(d.out)];
} else {
n, d.end, d.err = d.enc.decode(p, d.buf[0:nr])
diff --git a/src/pkg/encoding/git85/git.go b/src/pkg/encoding/git85/git.go
index 288fd748c..cbc78fc3c 100644
--- a/src/pkg/encoding/git85/git.go
+++ b/src/pkg/encoding/git85/git.go
@@ -241,7 +241,7 @@ func (d *decoder) Read(p []byte) (n int, err os.Error) {
for {
// Copy leftover output from last decode.
if len(d.out) > 0 {
- n = bytes.Copy(p, d.out);
+ n = copy(p, d.out);
d.out = d.out[n:len(d.out)];
return;
}
@@ -270,7 +270,7 @@ func (d *decoder) Read(p []byte) (n int, err os.Error) {
d.err = CorruptInputError(int64(e) + d.off)
}
d.out = d.outbuf[0:nn];
- d.nbuf = bytes.Copy(&d.buf, d.buf[nl+1:d.nbuf]);
+ d.nbuf = copy(&d.buf, d.buf[nl+1:d.nbuf]);
d.off += int64(nl + 1);
}
panic("unreacahable");