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

Set map fields in _getDefault, minor refactoring #707

Merged
merged 3 commits into from
Jul 11, 2022

Conversation

osa1
Copy link
Member

@osa1 osa1 commented Jul 11, 2022

  • $_getMap when called on an uninitialized map field initializes the field.
    Update getField to do the same.

    getField already initializes repeated fields, but it used to not initialize
    map fields.

    Fixes Unable to initialise a null map field by field number #373

    This is a sync of cl/442686654.

  • Inline _getDefaultList into _$getList and _getDefaultMap into
    _$getMap. These inlined functions have only one use site, and inlining them
    makes the _$getList and _$getMap easier to compare for consistency.

@osa1 osa1 requested a review from mraleph July 11, 2022 08:12
@osa1 osa1 merged commit d610d12 into google:master Jul 11, 2022
@osa1 osa1 deleted the getDefault_fix branch July 11, 2022 08:30
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

Successfully merging this pull request may close these issues.

Unable to initialise a null map field by field number
2 participants