summaryrefslogtreecommitdiff
path: root/src/pkg/xml/xml.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2009-11-18 15:24:24 -0800
committerRob Pike <r@golang.org>2009-11-18 15:24:24 -0800
commit391051631f6118f60751735160d4f5a4b41ba5db (patch)
treea54bad89b8447ed713d40539471ce8d1b9f811ff /src/pkg/xml/xml.go
parente97248aec165fe74b5b765813d8d8f9e44790910 (diff)
downloadgolang-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/xml/xml.go')
-rw-r--r--src/pkg/xml/xml.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pkg/xml/xml.go b/src/pkg/xml/xml.go
index 202cd4626..c3b91fd5f 100644
--- a/src/pkg/xml/xml.go
+++ b/src/pkg/xml/xml.go
@@ -65,19 +65,19 @@ type EndElement struct {
// the characters they represent.
type CharData []byte
-func copy(b []byte) []byte {
+func makeCopy(b []byte) []byte {
b1 := make([]byte, len(b));
- bytes.Copy(b1, b);
+ copy(b1, b);
return b1;
}
-func (c CharData) Copy() CharData { return CharData(copy(c)) }
+func (c CharData) Copy() CharData { return CharData(makeCopy(c)) }
// A Comment represents an XML comment of the form <!--comment-->.
// The bytes do not include the <!-- and --> comment markers.
type Comment []byte
-func (c Comment) Copy() Comment { return Comment(copy(c)) }
+func (c Comment) Copy() Comment { return Comment(makeCopy(c)) }
// A ProcInst represents an XML processing instruction of the form <?target inst?>
type ProcInst struct {
@@ -86,7 +86,7 @@ type ProcInst struct {
}
func (p ProcInst) Copy() ProcInst {
- p.Inst = copy(p.Inst);
+ p.Inst = makeCopy(p.Inst);
return p;
}
@@ -94,7 +94,7 @@ func (p ProcInst) Copy() ProcInst {
// The bytes do not include the <! and > markers.
type Directive []byte
-func (d Directive) Copy() Directive { return Directive(copy(d)) }
+func (d Directive) Copy() Directive { return Directive(makeCopy(d)) }
type readByter interface {
ReadByte() (b byte, err os.Error);