Change serialization for ChildFieldIDs #11996
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Only relevant change: moving from [de]serializing
unique_ptr<case_insensitive_map_t<FieldID>>
to [de]serializingcase_insensitive_map_t<FieldID>
, given in this particular case the unique_ptr is always valid it should be OK iff:There are other possible solution to this problem, but giving they require to add surface I went for the minimal fix.
Probably figuring out the underlying cause of failures in serialization, that are somewhere at the interstection of unique_ptr and serialization of vectors, but have not been able to figure out a proper fix there.
I also added two minor improvements (I think): forcing 0 initialization of buffers (although not needed) and enforcing invariant that while pre-fetching bytes to check for field ID no bytes are ever read from the stream. Neither were actual problems, but I think it make sense to add those lightweight changes.
Closes #11985