gdiplus: Simplify logic/control flow in SOFTWARE_GdipFillRegion.

Gerald Pfeifer gerald at pfeifer.com
Sat Apr 2 15:36:50 CDT 2011


This doesn't make things tremendously simpler, but does avoid one
unnecessary if / condition.

If you prefer, I can switch the two arms of the if to retain the
original !scans.

Gerald

---
 dlls/gdiplus/graphics.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 4fdfa9c..49f3495 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -3709,16 +3709,15 @@ static GpStatus SOFTWARE_GdipFillRegion(GpGraphics *graphics, GpBrush *brush,
             if (stat == Ok && scans_count != 0)
             {
                 scans = GdipAlloc(sizeof(*scans) * scans_count);
-                if (!scans)
-                    stat = OutOfMemory;
-
-                if (stat == Ok)
+                if (scans)
                 {
                     stat = GdipGetRegionScansI(temp_region, scans, &dummy, identity);
 
                     if (stat != Ok)
                         GdipFree(scans);
                 }
+                else
+                    stat = OutOfMemory;
             }
 
             GdipDeleteMatrix(identity);
-- 
1.7.4.1



More information about the wine-patches mailing list