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

use 'switch' for 'oneof' in Serialize and IsInitialized #557

Closed
niuys opened this issue Jun 30, 2015 · 1 comment
Closed

use 'switch' for 'oneof' in Serialize and IsInitialized #557

niuys opened this issue Jun 30, 2015 · 1 comment

Comments

@niuys
Copy link

niuys commented Jun 30, 2015

In generated cpp code, is it ok to use 'switch' for 'oneof' in method 'SerializeWithCachedSizes', 'SerializeWithCachedSizesToArray' and 'IsInitialized '? If the field num is too many in a 'oneof',this can reduce time cost.

taoso pushed a commit to taoso/protobuf that referenced this issue Aug 1, 2018
There's no need for oneof sizers to compute the size of the tag/wire
varint, since it can be computed at proto compile time instead (and it
is typically a small number like 1 or 2).
@ghost
Copy link

ghost commented Jun 10, 2019

Seems like this was already implemented. Closing.

@ghost ghost closed this as completed Jun 10, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants