--- libev/ev.c 2007/10/31 14:44:15 1.17 +++ libev/ev.c 2007/10/31 16:29:52 1.18 @@ -418,11 +418,9 @@ static void call_pending () { - int i; - - for (i = 0; i < pendingcnt; ++i) + while (pendingcnt) { - ANPENDING *p = pendings + i; + ANPENDING *p = pendings + --pendingcnt; if (p->w) { @@ -430,8 +428,6 @@ p->w->cb (p->w, p->events); } } - - pendingcnt = 0; } static void