Skip to content

Commit

Permalink
more succinct
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis committed Dec 19, 2024
1 parent 951e806 commit 41f3327
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/dpp/socketengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 41f3327

Please sign in to comment.