convert *[] to [].
R=r
OCL=21563
CL=21571
diff --git a/src/lib/fmt/print.go b/src/lib/fmt/print.go
index 426bca1..def4760 100644
--- a/src/lib/fmt/print.go
+++ b/src/lib/fmt/print.go
@@ -20,7 +20,7 @@
// Provides access to the io.Write interface plus information about
// the active formatting verb.
export type Formatter interface {
- Write(b *[]byte) (ret int, err *os.Error);
+ Write(b []byte) (ret int, err *os.Error);
Width() (wid int, ok bool);
Precision() (prec int, ok bool);
@@ -41,7 +41,7 @@
type P struct {
n int;
- buf *[]byte;
+ buf []byte;
fmt *Fmt;
}
@@ -76,11 +76,8 @@
}
func (p *P) ensure(n int) {
- if p.buf == nil || len(p.buf) < n {
- newn := AllocSize;
- if p.buf != nil {
- newn += len(p.buf);
- }
+ if len(p.buf) < n {
+ newn := AllocSize + len(p.buf);
if newn < n {
newn = n + AllocSize
}
@@ -101,7 +98,7 @@
}
}
-func (p *P) addbytes(b *[]byte, start, end int) {
+func (p *P) addbytes(b []byte, start, end int) {
p.ensure(p.n + end-start);
for i := start; i < end; i++ {
p.buf[p.n] = b[i];
@@ -121,7 +118,7 @@
// Implement Write so we can call fprintf on a P, for
// recursive use in custom verbs.
-func (p *P) Write(b *[]byte) (ret int, err *os.Error) {
+func (p *P) Write(b []byte) (ret int, err *os.Error) {
p.addbytes(b, 0, len(b));
return len(b), nil;
}
@@ -257,7 +254,7 @@
case reflect.StringKind:
return v.(reflect.StringValue).Get(), true;
}
- if valb, okb := v.Interface().(*[]byte); okb {
+ if valb, okb := v.Interface().([]byte); okb {
return string(valb), true;
}
return "", false;