From 457f1b2699cd8e35a36a94f8d59c34c54c6e04d6 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 23 Apr 2020 11:22:36 -0700 Subject: [PATCH] Remove RefCountedPtrLess. --- src/core/ext/filters/client_channel/client_channel.cc | 3 +-- src/core/lib/gprpp/map.h | 8 -------- src/core/lib/gprpp/ref_counted_ptr.h | 5 +++++ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index aea8e00a501..d7004551400 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -305,8 +305,7 @@ class ChannelData { // Pending ConnectedSubchannel updates for each SubchannelWrapper. // Updates are queued here in the control plane work_serializer and then // applied in the data plane mutex when the picker is updated. - std::map, RefCountedPtr, - RefCountedPtrLess> + std::map, RefCountedPtr> pending_subchannel_updates_; // diff --git a/src/core/lib/gprpp/map.h b/src/core/lib/gprpp/map.h index 033b861c77f..f14f3f6fc84 100644 --- a/src/core/lib/gprpp/map.h +++ b/src/core/lib/gprpp/map.h @@ -46,14 +46,6 @@ struct StringLess { } }; -template -struct RefCountedPtrLess { - bool operator()(const RefCountedPtr& p1, - const RefCountedPtr& p2) const { - return p1.get() < p2.get(); - } -}; - } // namespace grpc_core #endif /* GRPC_CORE_LIB_GPRPP_MAP_H */ diff --git a/src/core/lib/gprpp/ref_counted_ptr.h b/src/core/lib/gprpp/ref_counted_ptr.h index 4c5b46538a8..179491b22c2 100644 --- a/src/core/lib/gprpp/ref_counted_ptr.h +++ b/src/core/lib/gprpp/ref_counted_ptr.h @@ -182,6 +182,11 @@ inline RefCountedPtr MakeRefCounted(Args&&... args) { return RefCountedPtr(new T(std::forward(args)...)); } +template +bool operator<(const RefCountedPtr& p1, const RefCountedPtr& p2) { + return p1.get() < p2.get(); +} + } // namespace grpc_core #endif /* GRPC_CORE_LIB_GPRPP_REF_COUNTED_PTR_H */