File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed
Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change @@ -91,12 +91,6 @@ export class CapacityEstimatorCodegen extends AbstractCodegen<CompiledCapacityEs
9191 const { _head = [ ] , _type, _tail = [ ] } = type ;
9292 const headLength = _head . length ;
9393 const tailLength = _tail . length ;
94- // const tupleLength = headLength + tailLength;
95- // if (tupleLength) {
96- // codegen.if(/* js */ `${rLen} < ${tupleLength}`, () => {
97- // codegen.js(/* js */ `throw new Error('INV_LEN');`);
98- // });
99- // }
10094 if ( _type ) {
10195 const isConstantSizeType = _type instanceof ConType || _type instanceof BoolType || _type instanceof NumType ;
10296 if ( isConstantSizeType ) {
@@ -106,7 +100,7 @@ export class CapacityEstimatorCodegen extends AbstractCodegen<CompiledCapacityEs
106100 : _type instanceof BoolType
107101 ? MaxEncodingOverhead . Boolean
108102 : MaxEncodingOverhead . Number ;
109- codegen . js ( /* js */ `size += ${ rLen } * ${ elementSize } ;` ) ;
103+ codegen . js ( /* js */ `size += ( ${ rLen } - ${ headLength + tailLength } ) * ${ elementSize } ;` ) ;
110104 } else {
111105 const rv = codegen . var ( r . use ( ) ) ;
112106 const ri = codegen . getRegister ( ) ;
You can’t perform that action at this time.
0 commit comments