Merge pull request #443 from markdroth/create-pull-request/patch-667de34

Automated fix for refs/heads/ref_counted_const
pull/35188/head
Mark D. Roth 1 year ago committed by GitHub
commit e2dc753b6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/core/lib/gprpp/ref_counted.h

@ -330,9 +330,8 @@ class RefCounted : public Impl {
// RefIfNonZero() for const types. // RefIfNonZero() for const types.
GRPC_MUST_USE_RESULT RefCountedPtr<const Child> RefIfNonZero() const { GRPC_MUST_USE_RESULT RefCountedPtr<const Child> RefIfNonZero() const {
return RefCountedPtr<const Child>(refs_.RefIfNonZero() return RefCountedPtr<const Child>(
? static_cast<const Child*>(this) refs_.RefIfNonZero() ? static_cast<const Child*>(this) : nullptr);
: nullptr);
} }
GRPC_MUST_USE_RESULT RefCountedPtr<const Child> RefIfNonZero( GRPC_MUST_USE_RESULT RefCountedPtr<const Child> RefIfNonZero(
const DebugLocation& location, const char* reason) const { const DebugLocation& location, const char* reason) const {
@ -362,8 +361,8 @@ class RefCounted : public Impl {
friend class RefCountedPtr; friend class RefCountedPtr;
void IncrementRefCount() const { refs_.Ref(); } void IncrementRefCount() const { refs_.Ref(); }
void IncrementRefCount(const DebugLocation& location, const char* reason) void IncrementRefCount(const DebugLocation& location,
const { const char* reason) const {
refs_.Ref(location, reason); refs_.Ref(location, reason);
} }

Loading…
Cancel
Save