Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization - get field deserializers doesn't need to be passed the current object in most languages #1490

Closed
Tracked by #25 ...
baywet opened this issue Apr 4, 2022 · 0 comments · Fixed by #1491
Closed
Tracked by #25 ...
Assignees
Labels
Csharp Pull requests that update .net code fixed generator Issues or improvements relater to generation capabilities. Go Java TypeScript Pull requests that update Javascript code

Comments

@baywet
Copy link
Member

baywet commented Apr 4, 2022

The callback for field deserializers see this example doesn't need to be passed the current object.

Effectively this

{"aboutMe", (o,n) => { (o as User).AboutMe = n.GetStringValue(); } },

Can be changed to that

{"aboutMe", (n) => { this.AboutMe = n.GetStringValue(); } },

And the parent method return type can be simplified.

This will contribute to making the generated code smaller as well as the byte code, which has been a challenge for Go and TypeScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Csharp Pull requests that update .net code fixed generator Issues or improvements relater to generation capabilities. Go Java TypeScript Pull requests that update Javascript code
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant