-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change refactors `OneOfField` so that all fields in a given `oneof` construct share the same backing attributes on their container class -- `which_{oneof name}`, which holds the (string) name of the currently-active member of the oneof named `{oneof name}` (or `None` if no member is active), and `_value_{oneof name}`, which holds the value of the currently-active member (or `None`). This avoids looping through field specs in order to do an update or to figure out which member of a `oneof` is currently active. Since the `WhichOneof()` method is now a trivial read of a similarly-named attribute, it can be inlined for a small decrease in overall code size and without sacrificing readability. As a result of these changes, the compiler now runs 4.5% faster on my large test `.emb`.
- Loading branch information
Showing
17 changed files
with
140 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.