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) => {
77 let left = val ;
88
99 while ( left ) {
10- const bits = ( left & DATA_BITS ) | CONT_BITS ; // set continuation everywhere
10+ const bits = ( left & DATA_BITS ) | CONT_BITS ;
1111 left = left >>> LENGTH ;
1212 buf . push ( bits ) ;
1313 }
14- buf [ 0 ] = buf [ 0 ] & DATA_BITS ; // cancel the last continuation
14+ buf [ 0 ] = buf [ 0 ] & DATA_BITS ;
1515 return buf . reverse ( ) ;
1616} ;
1717
@@ -21,7 +21,7 @@ const decodeOne = (buf) => {
2121 for ( let i = 0 ; i < buf . length ; i ++ ) {
2222 val = ( val << LENGTH ) | ( buf [ i ] & DATA_BITS ) ;
2323 }
24- return val >>> 0 ; // convert to unsigned 32-bit
24+ return val >>> 0 ;
2525} ;
2626
2727export const encode = ( data ) => {
You can’t perform that action at this time.
0 commit comments