[PATCH] exa: don't need to check for NULL pointer if we already assumed it has a value

Tiago Vignatti tiago.vignatti at nokia.com
Mon Apr 19 10:58:05 PDT 2010


the alternative would be to check ps in the beginning of the function.
---
 exa/exa.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/exa/exa.c b/exa/exa.c
index 590d9a5..b2bd1c5 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -779,14 +779,12 @@ exaCloseScreen(int i, ScreenPtr pScreen)
     unwrap(pExaScr, pScreen, BitmapToRegion);
     unwrap(pExaScr, pScreen, CreateScreenResources);
 #ifdef RENDER
-    if (ps) {
-	unwrap(pExaScr, ps, Composite);
-	if (pExaScr->SavedGlyphs)
-	    unwrap(pExaScr, ps, Glyphs);
-	unwrap(pExaScr, ps, Trapezoids);
-	unwrap(pExaScr, ps, Triangles);
-	unwrap(pExaScr, ps, AddTraps);
-    }
+    unwrap(pExaScr, ps, Composite);
+    if (pExaScr->SavedGlyphs)
+	unwrap(pExaScr, ps, Glyphs);
+    unwrap(pExaScr, ps, Trapezoids);
+    unwrap(pExaScr, ps, Triangles);
+    unwrap(pExaScr, ps, AddTraps);
 #endif
 
     xfree (pExaScr);
-- 
1.6.0.4



More information about the xorg-devel mailing list