socket_handle_watch: break when found is TRUE in server

skip useless loop when `found` is TRUE.
This MR is a response to issue #431.

Signed-off-by: Aiknow <shixin21@huawei.com>
This commit is contained in:
Aiknow 2022-12-15 10:38:12 +08:00 committed by Xin Shi
parent ce5c01ae41
commit 4f6e029598

View file

@ -172,7 +172,10 @@ socket_handle_watch (DBusWatch *watch,
for (i = 0 ; i < socket_server->n_fds ; i++)
{
if (socket_server->watch[i] == watch)
found = TRUE;
{
found = TRUE;
break;
}
}
_dbus_assert (found);
#endif