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

Question - why all the i+0 ? #24

Open
zfLQ2qx2 opened this issue Jan 27, 2019 · 2 comments
Open

Question - why all the i+0 ? #24

zfLQ2qx2 opened this issue Jan 27, 2019 · 2 comments

Comments

@zfLQ2qx2
Copy link

One question - in the generated code I see many instances of i+0. I'm pretty sure that the compiler will optimize those out, but I'm curious why they are there.

@zfLQ2qx2
Copy link
Author

@andyleap ^^

@andyleap
Copy link
Owner

Fixed length fields are handled by incrementing the 0 portion, rather then having to increment the i. The generator only emits the i once it's been incremented, which means structs that are completely fixed size can be generated as nothing more then a series of byte operations, completely bypassing the need to mess with the index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants