theweipeng commented on code in PR #3426:
URL: https://github.com/apache/fory/pull/3426#discussion_r2866989468
##########
javascript/packages/fory/lib/gen/map.ts:
##########
@@ -400,8 +404,14 @@ export class MapSerializerGenerator extends
BaseSerializerGenerator {
const count = this.scope.uniqueName("count");
const result = this.scope.uniqueName("result");
+ const foryName = this.builder.getForyName();
+ const maxEntriesVar = this.scope.uniqueName("maxMapEntries");
return `
let ${count} = ${this.builder.reader.readVarUint32Small7()};
+ const ${maxEntriesVar} = ${foryName}.config.maxMapEntries;
Review Comment:
Try to calculate the constants well during the code generation stage to
reduce the consumption in runtime
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]