Skip to content

Remove invalid check in _FieldSet.writeFieldValue - #660

Merged
osa1 merged 1 commit into
google:masterfrom
osa1:remove_todo
May 25, 2022
Merged

osa1 merged 1 commit into
google:masterfrom
osa1:remove_todo

Conversation

@osa1

@osa1 osa1 commented May 24, 2022 •

Copy link
Copy Markdown
Contributor

A field value is one of these:

ByteData is not a valid field value type, so remove the ByteData
cases when checking field value types.


cl/450892812

A field value is one of these:

- PbListBase (for `repeated`, PbList after #626)
- PbMap
- int
- double
- bool
- String
- List<int> (for `bytes`)
- GeneratedMessage

`ByteData` is not a valid field value type, so remove the `ByteData`
cases when checking field value types.
@osa1
osa1 requested a review from sigurdm May 24, 2022 07:19

@sigurdm sigurdm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Nice cleanup - am I understanding correctly that protobuf bytes are never stored as ByteData, but rather as a Uint8List backed by ByteData?

@osa1

osa1 commented May 24, 2022

Copy link
Copy Markdown
Contributor Author

Nice cleanup - am I understanding correctly that protobuf bytes are never stored as ByteData, but rather as a Uint8List backed by ByteData?

Protobuf bytes fields are never stored as ByteData, but they're also not always Uint8List. When deserializing we use Uint8List, but for the default value of bytes fields we use <int>[]. No idea what the concrete type is in this case.

@osa1
osa1 merged commit c3b3af3 into google:master May 25, 2022
@osa1
osa1 deleted the remove_todo branch May 25, 2022 07:06
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.

2 participants