From c255bf4676ac039b0718466c503f1f0064610742 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Thu, 11 Jan 2007 15:47:06 +0100 Subject: [PATCH] xrandr: Small X11DRV_XRandR_(Get|Set)CurrentMode() code optimisations. --- dlls/winex11.drv/xrandr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index 82827944335..997fc72f03a 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -162,6 +162,8 @@ static int X11DRV_XRandR_GetCurrentMode(void) sc = pXRRGetScreenInfo (gdi_display, root); size = pXRRConfigCurrentConfiguration (sc, &rot); rate = pXRRConfigCurrentRate (sc); + pXRRFreeScreenConfigInfo(sc); + wine_tsx11_unlock(); for (i = 0; i < real_xrandr_modes_count; i++) { if ( (dd_modes[i].dwWidth == real_xrandr_sizes[size].width ) && @@ -169,10 +171,9 @@ static int X11DRV_XRandR_GetCurrentMode(void) (dd_modes[i].wRefreshRate == rate ) ) { res = i; + break; } } - pXRRFreeScreenConfigInfo(sc); - wine_tsx11_unlock(); if (res == -1) { ERR("In unknown mode, returning default\n"); @@ -226,6 +227,7 @@ static void X11DRV_XRandR_SetCurrentMode(int mode) dd_modes[mode].dwWidth, dd_modes[mode].dwHeight, rate); stat = pXRRSetScreenConfigAndRate (gdi_display, sc, root, size, rot, rate, CurrentTime); + break; } } } @@ -235,6 +237,7 @@ static void X11DRV_XRandR_SetCurrentMode(int mode) dd_modes[mode].dwWidth, dd_modes[mode].dwHeight); stat = pXRRSetScreenConfig (gdi_display, sc, root, size, rot, CurrentTime); } + break; } } pXRRFreeScreenConfigInfo(sc);