Skip to content

Commit

Permalink
Remove dead code.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 592534243
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Dec 20, 2023
1 parent 9d749cd commit 95ff734
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions src/google/protobuf/repeated_ptr_field.h
Original file line number Diff line number Diff line change
Expand Up @@ -482,36 +482,6 @@ class PROTOBUF_EXPORT RepeatedPtrFieldBase {

int ClearedCount() const { return allocated_size() - current_size_; }

template <typename TypeHandler>
void AddCleared(Value<TypeHandler>* 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 <typename TypeHandler>
PROTOBUF_NODISCARD Value<TypeHandler>* 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<TypeHandler>(tagged_rep_or_elem_);
tagged_rep_or_elem_ = nullptr;
return result;
} else {
return cast<TypeHandler>(element_at(--rep()->allocated_size));
}
}

// Slowpath handles all cases, copying if necessary.
template <typename TypeHandler>
PROTOBUF_NOINLINE void AddAllocatedSlowWithCopy(
Expand Down

0 comments on commit 95ff734

Please sign in to comment.