Microoptimization we can do because the array is sorted by type.
if (idx == 0)
goto found;
idx--;
+ } else if (GST_EVENT_TYPE (ev->event) > type) {
+ break;
}
}
ev = NULL;
ev = &g_array_index (events, PadEvent, i);
if (event == ev->event)
goto found;
+ else if (GST_EVENT_TYPE (ev->event) > GST_EVENT_TYPE (event))
+ break;
}
ev = NULL;
found:
if (ev->event == NULL)
goto next;
- if (GST_EVENT_TYPE (ev->event) != type)
+ if (GST_EVENT_TYPE (ev->event) > type)
+ break;
+ else if (GST_EVENT_TYPE (ev->event) != type)
goto next;
gst_event_unref (ev->event);