From 95ff734d6bbcdaf0722649558f59f30939c1d89a Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Wed, 20 Dec 2023 05:45:11 -0800 Subject: [PATCH] Remove dead code. PiperOrigin-RevId: 592534243 --- src/google/protobuf/repeated_ptr_field.h | 30 ------------------------ 1 file changed, 30 deletions(-) diff --git a/src/google/protobuf/repeated_ptr_field.h b/src/google/protobuf/repeated_ptr_field.h index cf2d667eec33..3722fe075099 100644 --- a/src/google/protobuf/repeated_ptr_field.h +++ b/src/google/protobuf/repeated_ptr_field.h @@ -482,36 +482,6 @@ class PROTOBUF_EXPORT RepeatedPtrFieldBase { int ClearedCount() const { return allocated_size() - current_size_; } - template - void AddCleared(Value* value) { - ABSL_DCHECK(GetArena() == nullptr) << "AddCleared() can only be used on a " - "RepeatedPtrField not on an arena."; - ABSL_DCHECK(TypeHandler::GetArena(value) == nullptr) - << "AddCleared() can only accept values not on an arena."; - MaybeExtend(); - if (using_sso()) { - tagged_rep_or_elem_ = value; - } else { - element_at(rep()->allocated_size++) = value; - } - } - - template - PROTOBUF_NODISCARD Value* ReleaseCleared() { - ABSL_DCHECK(GetArena() == nullptr) - << "ReleaseCleared() can only be used on a RepeatedPtrField not on " - << "an arena."; - ABSL_DCHECK(tagged_rep_or_elem_ != nullptr); - ABSL_DCHECK_GT(allocated_size(), current_size_); - if (using_sso()) { - auto* result = cast(tagged_rep_or_elem_); - tagged_rep_or_elem_ = nullptr; - return result; - } else { - return cast(element_at(--rep()->allocated_size)); - } - } - // Slowpath handles all cases, copying if necessary. template PROTOBUF_NOINLINE void AddAllocatedSlowWithCopy(