[cairo-commit] src/cairo-path-fixed.c

Jeff Muizelaar jrmuizel at kemper.freedesktop.org
Fri May 7 07:35:20 PDT 2010


 src/cairo-path-fixed.c |   22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

New commits:
commit 01a208f7e3785254dc101f09a73943ec7cfb1d6e
Author: timeless <timeless at bemail.org>
Date:   Fri May 7 10:24:49 2010 -0400

    Remove useless null checks of a and b in _cairo_path_fixed_equal
    
    'a' and 'b' are dereferenced before being checked for null.
    
    From https://bugzilla.mozilla.org/show_bug.cgi?id=555706

diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
index 4640f55..078dfcb 100644
--- a/src/cairo-path-fixed.c
+++ b/src/cairo-path-fixed.c
@@ -249,20 +249,16 @@ _cairo_path_fixed_equal (const cairo_path_fixed_t *a,
     }
 
     num_ops_a = num_points_a = 0;
-    if (a != NULL) {
-	cairo_path_foreach_buf_start (buf_a, a) {
-	    num_ops_a    += buf_a->num_ops;
-	    num_points_a += buf_a->num_points;
-	} cairo_path_foreach_buf_end (buf_a, a);
-    }
+    cairo_path_foreach_buf_start (buf_a, a) {
+	num_ops_a    += buf_a->num_ops;
+	num_points_a += buf_a->num_points;
+    } cairo_path_foreach_buf_end (buf_a, a);
 
     num_ops_b = num_points_b = 0;
-    if (b != NULL) {
-	cairo_path_foreach_buf_start (buf_b, b) {
-	    num_ops_b    += buf_b->num_ops;
-	    num_points_b += buf_b->num_points;
-	} cairo_path_foreach_buf_end (buf_b, b);
-    }
+    cairo_path_foreach_buf_start (buf_b, b) {
+	num_ops_b    += buf_b->num_ops;
+	num_points_b += buf_b->num_points;
+    } cairo_path_foreach_buf_end (buf_b, b);
 
     if (num_ops_a == 0 && num_ops_b == 0)
 	return TRUE;
@@ -270,8 +266,6 @@ _cairo_path_fixed_equal (const cairo_path_fixed_t *a,
     if (num_ops_a != num_ops_b || num_points_a != num_points_b)
 	return FALSE;
 
-    assert (a != NULL && b != NULL);
-
     buf_a = cairo_path_head (a);
     num_points_a = buf_a->num_points;
     num_ops_a = buf_a->num_ops;


More information about the cairo-commit mailing list