summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortimeless <timeless@bemail.org>2010-05-07 10:24:49 -0400
committerJeff Muizelaar <jmuizelaar@mozilla.com>2010-05-07 10:24:49 -0400
commit01a208f7e3785254dc101f09a73943ec7cfb1d6e (patch)
treef2ebfd213c4d37392c6bd1402cd2ee0855932674
parent0068d9b5cd09a7aa0c5a2ab4da97ca181934ff56 (diff)
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
-rw-r--r--src/cairo-path-fixed.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
index 4640f55f..078dfcb8 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;