From 8b3d26f5b6caff1766669deb0e2100d2dee3f185 Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Tue, 20 May 2008 12:39:28 -0700 Subject: [PATCH] Short-circuit PanoramiXTranslateVisualID after verifying that the visual actually exists first. This allows using PanoramiXTranslateVisualID to test whether a given visual made it through PanoramiXVisualConsolidate. --- Xext/panoramiX.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index eb7068925..2792dc714 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -850,10 +850,6 @@ PanoramiXTranslateVisualID(int screen, VisualID orig) VisualPtr pVisual = NULL; int i; - /* if screen is 0, orig is already the correct visual ID */ - if (screen == 0) - return orig; - for (i = 0; i < PanoramiXNumVisuals; i++) { if (orig == PanoramiXVisuals[i].vid) { pVisual = &PanoramiXVisuals[i]; @@ -864,6 +860,10 @@ PanoramiXTranslateVisualID(int screen, VisualID orig) if (!pVisual) return 0; + /* if screen is 0, orig is already the correct visual ID */ + if (screen == 0) + return orig; + /* found the original, now translate it relative to the backend screen */ for (i = 0; i < pOtherScreen->numVisuals; i++) { VisualPtr pOtherVisual = &pOtherScreen->visuals[i];