Skip to content

Commit

Permalink
Revert D62903158: Hide dynamic versions of AnyPatch::patchIfTypeIs an…
Browse files Browse the repository at this point in the history
…d AnyPatch::ensureAndPatch

Differential Revision:
D62903158

Original commit changeset: 8466e1f7dbed

Original Phabricator Diff: D62903158

fbshipit-source-id: c663c1169f0d410280d86de09928a7ac22957d52
  • Loading branch information
rratmansky authored and facebook-github-bot committed Sep 19, 2024
1 parent c299f78 commit f304c34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
14 changes: 2 additions & 12 deletions thrift/lib/thrift/detail/AnyPatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@

namespace apache {
namespace thrift {
namespace protocol {
namespace detail {

struct PatchBadgeFactory;
using Badge = folly::badge<PatchBadgeFactory>;

} // namespace detail
} // namespace protocol
namespace op {
namespace detail {

Expand Down Expand Up @@ -227,8 +219,7 @@ class AnyPatch : public BaseClearPatch<Patch, AnyPatch<Patch>> {

// The provided type MUST match with the value type of patch stored in
// provided patch as Thrift Any.
void patchIfTypeIs(
protocol::detail::Badge, type::Type type, type::AnyStruct patch) {
void patchIfTypeIs(type::Type type, type::AnyStruct patch) {
if (!type.isValid()) {
throwTypeNotValid(type);
}
Expand All @@ -240,8 +231,7 @@ class AnyPatch : public BaseClearPatch<Patch, AnyPatch<Patch>> {

// The provided type in ensureAny MUST match with the value type of patch
// stored in provided patch as Thrift Any.
void ensureAndPatch(
protocol::detail::Badge, type::AnyStruct ensure, type::AnyStruct patch) {
void ensureAndPatch(type::AnyStruct ensure, type::AnyStruct patch) {
throwIfInvalidOrUnsupportedAny(ensure);
throwIfInvalidOrUnsupportedAny(patch);
type::Type type = ensure.type().value();
Expand Down
2 changes: 1 addition & 1 deletion thrift/lib/thrift/detail/DynamicPatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ op::AnyPatch DiffVisitorBase::diffAny(
anySubPatch.data() =
*serializeObject<CompactProtocolWriter>(subPatch.toObject());
anySubPatch.type() = detail::toPatchType(*src.type());
patch.patchIfTypeIs(badge, *src.type(), std::move(anySubPatch));
patch.patchIfTypeIs(*src.type(), std::move(anySubPatch));
}

return patch;
Expand Down

0 comments on commit f304c34

Please sign in to comment.