File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
exercises/practice/variable-length-quantity/.meta Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ const encodeOne = (val) => {
7
7
let left = val ;
8
8
9
9
while ( left ) {
10
- const bits = ( left & DATA_BITS ) | CONT_BITS ; // set continuation everywhere
10
+ const bits = ( left & DATA_BITS ) | CONT_BITS ;
11
11
left = left >>> LENGTH ;
12
12
buf . push ( bits ) ;
13
13
}
14
- buf [ 0 ] = buf [ 0 ] & DATA_BITS ; // cancel the last continuation
14
+ buf [ 0 ] = buf [ 0 ] & DATA_BITS ;
15
15
return buf . reverse ( ) ;
16
16
} ;
17
17
@@ -21,7 +21,7 @@ const decodeOne = (buf) => {
21
21
for ( let i = 0 ; i < buf . length ; i ++ ) {
22
22
val = ( val << LENGTH ) | ( buf [ i ] & DATA_BITS ) ;
23
23
}
24
- return val >>> 0 ; // convert to unsigned 32-bit
24
+ return val >>> 0 ;
25
25
} ;
26
26
27
27
export const encode = ( data ) => {
You can’t perform that action at this time.
0 commit comments