From 2371820a800563d0a7a5a96e34f9e158bc81eb24 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 28 Jul 2009 17:20:19 -0700 Subject: change the encoding of uints to simplify overflow checking and to make them easier and faster to read. they are now either a one-byte value or a n-byte value preceded by a byte holding -n. R=rsc DELTA=150 (45 added, 7 deleted, 98 changed) OCL=32381 CL=32387 --- src/pkg/gob/decoder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pkg/gob/decoder.go') diff --git a/src/pkg/gob/decoder.go b/src/pkg/gob/decoder.go index 7dd99a076..91bfcbbb8 100644 --- a/src/pkg/gob/decoder.go +++ b/src/pkg/gob/decoder.go @@ -30,7 +30,7 @@ func NewDecoder(r io.Reader) *Decoder { dec := new(Decoder); dec.r = r; dec.seen = make(map[typeId] *wireType); - dec.state = new(decodeState); // buffer set in Decode(); rest is unimportant + dec.state = newDecodeState(nil); // buffer set in Decode(); rest is unimportant dec.oneByte = make([]byte, 1); return dec; -- cgit v1.2.3