Skip to content

Commit 99e79db

Browse files
ClaytonKnittelcopybara-github
authored andcommitted
Remove has_presence condition on updating cached_has_bits in serialize.
Implicit presence fields use hasbits, so there is no reason we shouldn't update cached_has_bits for them. PiperOrigin-RevId: 791897325
1 parent 6e4af48 commit 99e79db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/google/protobuf/compiler/cpp/message.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4856,7 +4856,7 @@ void MessageGenerator::GenerateSerializeWithCachedSizesBody(io::Printer* p) {
48564856
v_.push_back(field);
48574857
} else {
48584858
// TODO: Defer non-oneof fields similarly to oneof fields.
4859-
if (HasHasbit(field, options_) && field->has_presence()) {
4859+
if (HasHasbit(field, options_)) {
48604860
// We speculatively load the entire _has_bits_[index] contents, even
48614861
// if it is for only one field. Deferring non-oneof emitting would
48624862
// allow us to determine whether this is going to be useful.

0 commit comments

Comments
 (0)