[PATCH 10/22] saver: Don't open-code IsMapInstalled

Adam Jackson ajax at redhat.com
Tue Jul 22 08:46:30 PDT 2014


Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 Xext/saver.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/Xext/saver.c b/Xext/saver.c
index 8e92fdf..2c14ea0 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -467,9 +467,6 @@ CreateSaverWindow(ScreenPtr pScreen)
     WindowPtr pWin;
     int result;
     unsigned long mask;
-    Colormap *installedMaps;
-    int numInstalled;
-    int i;
     Colormap wantMap;
     ColormapPtr pCmap;
 
@@ -545,18 +542,7 @@ CreateSaverWindow(ScreenPtr pScreen)
 
     /* check and install our own colormap if it isn't installed now */
     wantMap = wColormap(pWin);
-    if (wantMap == None)
-        return TRUE;
-    installedMaps = malloc(pScreen->maxInstalledCmaps * sizeof(Colormap));
-    numInstalled = (*pWin->drawable.pScreen->ListInstalledColormaps)
-        (pScreen, installedMaps);
-    for (i = 0; i < numInstalled; i++)
-        if (installedMaps[i] == wantMap)
-            break;
-
-    free((char *) installedMaps);
-
-    if (i < numInstalled)
+    if (wantMap == None || IsMapInstalled(wantMap, pWin))
         return TRUE;
 
     result = dixLookupResourceByType((void **) &pCmap, wantMap, RT_COLORMAP,
-- 
1.9.3



More information about the xorg-devel mailing list