wwbmmm commented on code in PR #2632:
URL: https://github.com/apache/brpc/pull/2632#discussion_r1593739870


##########
src/butil/thread_key.h:
##########
@@ -187,9 +205,9 @@ void ThreadLocal<T>::reset(T* ptr) {
         }
         // Remove and delete old_ptr.
         if (old_ptr) {
-            auto iter = std::find(ptrs.begin(), ptrs.end(), old_ptr);
-            if (iter!=ptrs.end()) {
-                ptrs.erase(iter);
+            auto iter = std::remove(ptrs.begin(), ptrs.end(), old_ptr);
+            if (iter != ptrs.end()) {
+                ptrs.erase(iter, ptrs.end());

Review Comment:
   原来的find方法有什么问题呢?



-- 
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: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to