The same binary search from the previous commit can be used in this
function too.
V2: Remove check from loop that is not needed anymore, pointed out by
Andrea Canciani.
return(TRUE);
}
- for (pbox = PIXREGION_BOXPTR (region), pbox_end = pbox + numRects;
- pbox != pbox_end;
- pbox++)
- {
- if (y >= pbox->y2)
- continue; /* not there yet */
+ pbox = PIXREGION_BOXPTR (region);
+ pbox_end = pbox + numRects;
+
+ pbox = find_box_for_y (pbox, pbox_end, y);
+ for (;pbox != pbox_end; pbox++)
+ {
if ((y < pbox->y1) || (x < pbox->x1))
break; /* missed it */