E (randr): We can actually optimize the searches a bit (given that the

list of modes is stored smallest to largest) based on if we are
shrinking or growing.



SVN revision: 77149
This commit is contained in:
Christopher Michael 2012-09-27 10:19:34 +00:00
parent 33ccce29fd
commit 50f569ff5e
1 changed files with 6 additions and 3 deletions

View File

@ -817,9 +817,9 @@ _e_smart_monitor_resolution_get(E_Smart_Data *sd, Evas_Coord width, Evas_Coord h
if (!sd) return NULL;
EINA_LIST_REVERSE_FOREACH(sd->modes, l, mode)
if (smaller)
{
if (smaller)
EINA_LIST_REVERSE_FOREACH(sd->modes, l, mode)
{
if ((((int)mode->width - SNAP_FUZZINESS) <= width) ||
(((int)mode->width + SNAP_FUZZINESS) <= width))
@ -833,7 +833,10 @@ _e_smart_monitor_resolution_get(E_Smart_Data *sd, Evas_Coord width, Evas_Coord h
}
}
}
else
}
else
{
EINA_LIST_FOREACH(sd->modes, l, mode)
{
if ((((int)mode->width - SNAP_FUZZINESS) >= width) ||
(((int)mode->width + SNAP_FUZZINESS) >= width))