TousakaRin commented on code in PR #2491:
URL: https://github.com/apache/brpc/pull/2491#discussion_r1440092282


##########
src/butil/memory/ref_counted.h:
##########
@@ -285,21 +285,19 @@ class scoped_refptr {
       ptr_->AddRef();
   }
 
-  scoped_refptr(scoped_refptr<T>&& r) noexcept {
+  scoped_refptr(scoped_refptr<T>&& r) noexcept : ptr_(r.ptr_) {
     if (r.ptr_){

Review Comment:
   这个判断去掉,直接让 r.ptr_ = nullptr; 是否更清晰一些。



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to