From 41f3327fae08e9284c1da88c7ebac20b0e7dede5 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Thu, 19 Dec 2024 02:48:57 +0000 Subject: [PATCH] more succinct --- src/dpp/socketengine.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/dpp/socketengine.cpp b/src/dpp/socketengine.cpp index c30061eb08..81c5fc925a 100644 --- a/src/dpp/socketengine.cpp +++ b/src/dpp/socketengine.cpp @@ -87,17 +87,15 @@ socket_events* socket_engine_base::get_fd(dpp::socket fd) { } void socket_engine_base::inplace_modify_fd(dpp::socket fd, uint8_t extra_flags) { - bool should_modify{false}; + bool should_modify; socket_events s{}; { - socket_events *new_se = nullptr; std::lock_guard lk(fds_mutex); auto i = fds.find(fd); should_modify = i != fds.end() && (i->second->flags & extra_flags) != extra_flags; if (should_modify) { - new_se = i->second.get(); - new_se->flags |= extra_flags; - s = *new_se; + i->second->flags |= extra_flags; + s = *(i->second); } } if (should_modify) {