Merge pull request #22705 from markdroth/ref_counted_ptr_less

Remove RefCountedPtrLess.
pull/22735/head
Mark D. Roth 5 years ago committed by GitHub
commit e652e17016
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/core/ext/filters/client_channel/client_channel.cc
  2. 8
      src/core/lib/gprpp/map.h
  3. 5
      src/core/lib/gprpp/ref_counted_ptr.h

@ -307,8 +307,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<SubchannelWrapper>, RefCountedPtr<ConnectedSubchannel>,
RefCountedPtrLess<SubchannelWrapper>>
std::map<RefCountedPtr<SubchannelWrapper>, RefCountedPtr<ConnectedSubchannel>>
pending_subchannel_updates_;
//

@ -46,14 +46,6 @@ struct StringLess {
}
};
template <typename T>
struct RefCountedPtrLess {
bool operator()(const RefCountedPtr<T>& p1,
const RefCountedPtr<T>& p2) const {
return p1.get() < p2.get();
}
};
} // namespace grpc_core
#endif /* GRPC_CORE_LIB_GPRPP_MAP_H */

@ -182,6 +182,11 @@ inline RefCountedPtr<T> MakeRefCounted(Args&&... args) {
return RefCountedPtr<T>(new T(std::forward<Args>(args)...));
}
template <typename T>
bool operator<(const RefCountedPtr<T>& p1, const RefCountedPtr<T>& p2) {
return p1.get() < p2.get();
}
} // namespace grpc_core
#endif /* GRPC_CORE_LIB_GPRPP_REF_COUNTED_PTR_H */

Loading…
Cancel
Save