Skip to content

Commit cfa38ca

Browse files
committed
Remove unnecessary empty checks
1 parent f2f9056 commit cfa38ca

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/control/reverse_interface.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,9 @@ void ReverseInterface::disconnectionCallback(const socket_t filedescriptor)
238238
URCL_LOG_INFO("Connection to reverse interface dropped.", filedescriptor);
239239
client_fd_ = INVALID_SOCKET;
240240
handle_program_state_(false);
241-
if (!disconnect_callbacks_.empty())
241+
for (auto handler : disconnect_callbacks_)
242242
{
243-
for (auto handler : disconnect_callbacks_)
244-
{
245-
handler.function(filedescriptor);
246-
}
243+
handler.function(filedescriptor);
247244
}
248245
}
249246

src/control/trajectory_point_interface.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,9 @@ void TrajectoryPointInterface::connectionCallback(const socket_t filedescriptor)
275275
void TrajectoryPointInterface::disconnectionCallback(const socket_t filedescriptor)
276276
{
277277
URCL_LOG_DEBUG("Connection to trajectory interface dropped.");
278-
if (!disconnect_callbacks_.empty())
278+
for (auto handler : disconnect_callbacks_)
279279
{
280-
for (auto handler : disconnect_callbacks_)
281-
{
282-
handler.function(filedescriptor);
283-
}
280+
handler.function(filedescriptor);
284281
}
285282
client_fd_ = INVALID_SOCKET;
286283
}

0 commit comments

Comments
 (0)