mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-14 19:55:12 +01:00
glib/gpoll: Remove if conditional
The original ready < nhandles - 1 can be re-written as ready + 1 < nhandles which is the same confition that we are checking on the first itteration of the for loop. This means we can remove the if statement and let the for loop check the code. This also has the side effect of removing an invalid check as WAIT_OBJECT_0 was not subtracted from ready in the if statement. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
This commit is contained in:
parent
425a9f5864
commit
d67b58a9a6
@ -235,9 +235,8 @@ poll_rest (gboolean poll_msgs,
|
||||
{
|
||||
/* Remove the handle that fired */
|
||||
int i;
|
||||
if (ready < nhandles - 1)
|
||||
for (i = ready - WAIT_OBJECT_0 + 1; i < nhandles; i++)
|
||||
handles[i-1] = handles[i];
|
||||
for (i = ready - WAIT_OBJECT_0 + 1; i < nhandles; i++)
|
||||
handles[i-1] = handles[i];
|
||||
nhandles--;
|
||||
recursed_result = poll_rest (FALSE, handles, nhandles, fds, nfds, 0);
|
||||
return (recursed_result == -1) ? -1 : 1 + recursed_result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user