diff options
Diffstat (limited to 'src/pkg/strings/reader.go')
-rw-r--r-- | src/pkg/strings/reader.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/pkg/strings/reader.go b/src/pkg/strings/reader.go index 80c745bb8..7cefbd24b 100644 --- a/src/pkg/strings/reader.go +++ b/src/pkg/strings/reader.go @@ -11,28 +11,28 @@ import "os" type Reader string func (r *Reader) Read(b []byte) (n int, err os.Error) { - s := *r; + s := *r if len(s) == 0 { return 0, os.EOF } for n < len(s) && n < len(b) { - b[n] = s[n]; - n++; + b[n] = s[n] + n++ } - *r = s[n:]; - return; + *r = s[n:] + return } func (r *Reader) ReadByte() (b byte, err os.Error) { - s := *r; + s := *r if len(s) == 0 { return 0, os.EOF } - b = s[0]; - *r = s[1:]; - return; + b = s[0] + *r = s[1:] + return } // NewReader returns a new Reader reading from s. // It is similar to bytes.NewBufferString but more efficient and read-only. -func NewReader(s string) *Reader { return (*Reader)(&s) } +func NewReader(s string) *Reader { return (*Reader)(&s) } |