File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -119,10 +119,10 @@ impl<const MAX_SIZE: usize> Encoder<MAX_SIZE> {
119
119
/// Compute the length of an arc when encoded in base 128.
120
120
const fn base128_len ( arc : Arc ) -> usize {
121
121
match arc {
122
- 0 ..=0x7f => 1 ,
123
- 0x80 ..=0x3fff => 2 ,
124
- 0x4000 ..=0x1fffff => 3 ,
125
- 0x200000 ..=0x1fffffff => 4 ,
122
+ 0 ..=0x7f => 1 , // up to 7 bits
123
+ 0x80 ..=0x3fff => 2 , // up to 14 bits
124
+ 0x4000 ..=0x1fffff => 3 , // up to 21 bits
125
+ 0x200000 ..=0x0fffffff => 4 , // up to 28 bits
126
126
_ => 5 ,
127
127
}
128
128
}
Original file line number Diff line number Diff line change @@ -11,3 +11,4 @@ cc d90305406041ea5e4cf4d9e7849cad03391db1869d0b1329f60ccbf1fabaee91 # shrinks to
11
11
cc 8ed8dde35d12a2c8e10cdde6d591a8f17f0cd6d6fdf90f1582536401364623bf # shrinks to s = "0.00"
12
12
cc ba5e3e3dc1a64870477e82054bbf6d8272f8b0d0c9094115bf7e8b5ff59f3c63 # shrinks to s = "00.1.1"
13
13
cc d211e943da9a0e3d0ee5097899b2435f784ca2b3d2f8d4790aae3744823a268a # shrinks to s = "1.1.1.60817410.1"
14
+ cc 61bdeaa6cfc6707a0c4f3e9c6165d99d28042e78acb29b0ca7f747c169e83e74 # shrinks to s = "1.1.1.270000000"
You can’t perform that action at this time.
0 commit comments