Skip to content

Commit

Permalink
hpb: collapse Serialize with PtrOrRaw<T>
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 705119290
  • Loading branch information
honglooker authored and copybara-github committed Dec 11, 2024
1 parent e170c43 commit 5471f18
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions hpb/hpb.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,8 @@ absl::StatusOr<T> Parse(absl::string_view bytes,
}

template <typename T>
absl::StatusOr<absl::string_view> Serialize(const T* message, hpb::Arena& arena,
int options = 0) {
return ::hpb::internal::Serialize(hpb::interop::upb::GetMessage(message),
::hpb::interop::upb::GetMiniTable(message),
arena.ptr(), options);
}

template <typename T>
absl::StatusOr<absl::string_view> Serialize(Ptr<T> message, hpb::Arena& arena,
absl::StatusOr<absl::string_view> Serialize(internal::PtrOrRaw<T> message,
hpb::Arena& arena,
int options = 0) {
return ::hpb::internal::Serialize(hpb::interop::upb::GetMessage(message),
::hpb::interop::upb::GetMiniTable(message),
Expand Down

0 comments on commit 5471f18

Please sign in to comment.