diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2007-10-09 11:08:58 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2007-10-10 14:21:25 +0100 |
commit | 32b78fffc3b8441029ee6b48762a7d0c06bb44a8 (patch) | |
tree | 0c800759601698077a9655fdc7213da531d37ec9 /src/cairo-traps.c | |
parent | 66563eddd8ba2610fa59341b9337a30533e70d56 (diff) |
[cairo-traps] Simplify the status interaction of traps_grow().
Simply return the error status from the traps_grow() function rather
than having an assignment in the return function and then immediately
another assignment of the error to the status member at its callsite.
Diffstat (limited to 'src/cairo-traps.c')
-rw-r--r-- | src/cairo-traps.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/cairo-traps.c b/src/cairo-traps.c index 1893fc20..099b09ef 100644 --- a/src/cairo-traps.c +++ b/src/cairo-traps.c @@ -257,22 +257,17 @@ _cairo_traps_grow (cairo_traps_t *traps) cairo_trapezoid_t *new_traps; int new_size = 2 * MAX (traps->traps_size, 16); - if (traps->status) - return traps->status; - if (traps->traps == traps->traps_embedded) { new_traps = _cairo_malloc_ab (new_size, sizeof (cairo_trapezoid_t)); if (new_traps) memcpy (new_traps, traps->traps, sizeof (traps->traps_embedded)); } else { new_traps = _cairo_realloc_ab (traps->traps, - new_size, sizeof (cairo_trapezoid_t)); + new_size, sizeof (cairo_trapezoid_t)); } - if (new_traps == NULL) { - traps->status = _cairo_error (CAIRO_STATUS_NO_MEMORY); - return traps->status; - } + if (new_traps == NULL) + return _cairo_error (CAIRO_STATUS_NO_MEMORY); traps->traps = new_traps; traps->traps_size = new_size; |