From 1186231b9648666a59177770a5fca8a3e5f594c6 Mon Sep 17 00:00:00 2001 From: cheniujh <1271435567@qq.com> Date: Fri, 20 Sep 2024 22:17:22 +0800 Subject: [PATCH] move declare position of in_conn to avoid unnecessary extra Ref from shared_ptr --- src/net/src/worker_thread.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net/src/worker_thread.cc b/src/net/src/worker_thread.cc index 1304fc296c..c4735f46b4 100644 --- a/src/net/src/worker_thread.cc +++ b/src/net/src/worker_thread.cc @@ -76,7 +76,7 @@ void* WorkerThread::ThreadMain() { NetFiredEvent* pfe = nullptr; char bb[2048]; NetItem ti; - std::shared_ptr in_conn = nullptr; + struct timeval when; gettimeofday(&when, nullptr); @@ -155,7 +155,7 @@ void* WorkerThread::ThreadMain() { continue; } } else { - in_conn = nullptr; + std::shared_ptr in_conn = nullptr; int should_close = 0; {