Hello rsc (cc: golang-dev@googlegroups.com), I'd like you to review this change.
LGTM On 8 January 2011 09:15, <r@golang.org> wrote: > Reviewers: rsc, > > Message: > Hello rsc (cc: golang-dev@googlegroups.com), > > I'd like you to review this change. > > > Description: > bytes.Buffer: Fix bug in UnreadByte. > Error check was inverted. > > Fixes issue 1396. > > Please review this at http://codereview.appspot.com/3851042/ > > Affected files: > M src/pkg/bytes/buffer.go > > > Index: src/pkg/bytes/buffer.go > =================================================================== > --- a/src/pkg/bytes/buffer.go > +++ b/src/pkg/bytes/buffer.go > @@ -291,7 +291,7 @@ > // read operation. If write has happened since the last read, UnreadByte > // returns an error. > func (b *Buffer) UnreadByte() os.Error { > - if b.lastRead == opReadRune || b.lastRead == opRead { > + if b.lastRead != opReadRune && b.lastRead != opRead { > return os.ErrorString("bytes.Buffer: UnreadByte: previous > operation was not a read") > } > b.lastRead = opInvalid > > >
*** Submitted as http://code.google.com/p/go/source/detail?r=9958da4a18a0 *** bytes.Buffer: Fix bug in UnreadByte. Error check was inverted. Fixes issue 1396. R=rsc, adg CC=golang-dev http://codereview.appspot.com/3851042
oops On 7 Jan 2011 22:41, <r@golang.org> wrote: > *** Submitted as > http://code.google.com/p/go/source/detail?r=9958da4a18a0 *** > > bytes.Buffer: Fix bug in UnreadByte. > Error check was inverted. > > Fixes issue 1396. > > R=rsc, adg > CC=golang-dev > http://codereview.appspot.com/3851042 > > > http://codereview.appspot.com/3851042/