mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-21 03:32:35 +03:00
Optimise white hot find_sides to take advantage of sorted float_children.
Now we have an early exit when we get to the floats above the area we're interested in.
This commit is contained in:
parent
948a93041d
commit
c13080d96c
@ -2062,8 +2062,14 @@ void find_sides(struct box *fl, int y0, int y1,
|
||||
|
||||
*left = *right = 0;
|
||||
for (; fl; fl = fl->next_float) {
|
||||
fy0 = fl->y;
|
||||
fy1 = fl->y + fl->height;
|
||||
if (fy1 < y0) {
|
||||
/* Floats are sorted in order of decreasing bottom pos.
|
||||
* Past here, all floats will be too high to concern us.
|
||||
*/
|
||||
return;
|
||||
}
|
||||
fy0 = fl->y;
|
||||
if (y0 < fy1 && fy0 <= y1) {
|
||||
if (fl->type == BOX_FLOAT_LEFT) {
|
||||
fx1 = fl->x + fl->width;
|
||||
|
Loading…
Reference in New Issue
Block a user