From 188dc380f3c3f96e235e8796f9a1a268e4452895 Mon Sep 17 00:00:00 2001 From: prettykernel Date: Fri, 25 Sep 2020 15:55:54 +0800 Subject: [PATCH] tiny optimization --- muduo/net/Channel.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/muduo/net/Channel.cc b/muduo/net/Channel.cc index 1e9a40ae7..e4e7e04ce 100644 --- a/muduo/net/Channel.cc +++ b/muduo/net/Channel.cc @@ -65,10 +65,9 @@ void Channel::remove() void Channel::handleEvent(Timestamp receiveTime) { - std::shared_ptr guard; if (tied_) { - guard = tie_.lock(); + std::shared_ptr guard = tie_.lock(); if (guard) { handleEventWithGuard(receiveTime);