mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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
This commit is contained in:
parent
189153ed13
commit
b85147cd70
7 changed files with 137 additions and 99 deletions
|
|
@ -50,8 +50,7 @@ func TestBasicEncoder(t *testing.T) {
|
|||
}
|
||||
|
||||
// Decode the result by hand to verify;
|
||||
state := new(decodeState);
|
||||
state.b = b;
|
||||
state := newDecodeState(b);
|
||||
// The output should be:
|
||||
// 0) The length, 38.
|
||||
length := decodeUint(state);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue