Skip to content

Commit

Permalink
Remove implementation related to lazy fields.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 691936133
  • Loading branch information
tonyliaoss authored and copybara-github committed Oct 31, 2024
1 parent 3a40367 commit 56580bd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
4 changes: 1 addition & 3 deletions src/google/protobuf/compiler/cpp/extension.cc
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,7 @@ void ExtensionGenerator::GenerateRegistration(io::Printer* p,
? absl::StrCat("&", message_type, "::InternalVerify")
: "nullptr"},
{"message_type", message_type},
{"lazy", descriptor_->options().has_lazy()
? descriptor_->options().lazy() ? "kLazy" : "kEager"
: "kUndefined"}});
{"lazy", "kUndefined"}});
if (using_implicit_weak_descriptors) {
p->Emit(
{
Expand Down
4 changes: 0 additions & 4 deletions src/google/protobuf/extension_set_heavy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,6 @@ bool DescriptorPoolExtensionFinder::Find(int number, ExtensionInfo* output) {
<< "Extension factory's GetPrototype() returned nullptr; extension: "
<< extension->full_name();

if (extension->options().has_lazy()) {
output->is_lazy = extension->options().lazy() ? LazyAnnotation::kLazy
: LazyAnnotation::kEager;
}
} else if (extension->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) {
output->enum_validity_check.func = ValidateEnumUsingDescriptor;
output->enum_validity_check.arg = extension->enum_type();
Expand Down
12 changes: 2 additions & 10 deletions src/google/protobuf/generated_message_reflection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -356,20 +356,12 @@ bool Reflection::IsLazyExtension(const Message& message,
}
bool Reflection::IsLazilyVerifiedLazyField(const FieldDescriptor* field) const {
if (field->type() != FieldDescriptor::TYPE_MESSAGE || field->is_repeated()) {
return false;
}
return field->options().unverified_lazy();
return false;
}
bool Reflection::IsEagerlyVerifiedLazyField(
const FieldDescriptor* field) const {
if (field->type() != FieldDescriptor::TYPE_MESSAGE) return false;
// Message fields with [lazy=true] will be eagerly verified
// (go/verified-lazy).
if (field->options().lazy() && !field->is_repeated()) return true;
return schema_.IsEagerlyVerifiedLazyField(field);
return false;
}
internal::field_layout::TransformValidation Reflection::GetLazyStyle(
Expand Down

0 comments on commit 56580bd

Please sign in to comment.