From b1fb7c9b94667ff917006bdf01a0d5a901c0ccc4 Mon Sep 17 00:00:00 2001 From: CEL Dev Team Date: Tue, 5 Nov 2024 18:31:34 -0800 Subject: [PATCH] Delete dead code from `MutableRepeatedFieldRef::Reserve()` down call stack PiperOrigin-RevId: 693544714 --- common/values/parsed_map_field_value.cc | 1 - common/values/parsed_repeated_field_value.cc | 1 - internal/well_known_types.cc | 3 --- 3 files changed, 5 deletions(-) diff --git a/common/values/parsed_map_field_value.cc b/common/values/parsed_map_field_value.cc index 6a0e3cc5d..a9d04f039 100644 --- a/common/values/parsed_map_field_value.cc +++ b/common/values/parsed_map_field_value.cc @@ -165,7 +165,6 @@ ParsedMapFieldValue ParsedMapFieldValue::Clone(Allocator<> allocator) const { auto cloned_field = cloned->GetReflection()->GetMutableRepeatedFieldRef( cel::to_address(cloned), field_); - cloned_field.Reserve(field.size()); cloned_field.CopyFrom(field); return ParsedMapFieldValue(std::move(cloned), field_); } diff --git a/common/values/parsed_repeated_field_value.cc b/common/values/parsed_repeated_field_value.cc index e66eba49c..a288bba88 100644 --- a/common/values/parsed_repeated_field_value.cc +++ b/common/values/parsed_repeated_field_value.cc @@ -160,7 +160,6 @@ ParsedRepeatedFieldValue ParsedRepeatedFieldValue::Clone( auto cloned_field = cloned->GetReflection()->GetMutableRepeatedFieldRef( cel::to_address(cloned), field_); - cloned_field.Reserve(field.size()); cloned_field.CopyFrom(field); return ParsedRepeatedFieldValue(std::move(cloned), field_); } diff --git a/internal/well_known_types.cc b/internal/well_known_types.cc index f18d11b03..5da4bd2b0 100644 --- a/internal/well_known_types.cc +++ b/internal/well_known_types.cc @@ -1538,9 +1538,6 @@ void ListValueReflection::ReserveValues(absl::NonnullGetDescriptor(), descriptor_); - if (capacity > 0) { - MutableValues(message).Reserve(capacity); - } } absl::StatusOr GetListValueReflection(