mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-04 02:50:19 +01:00
Cleanup multi-line if condition
The standard idiom of assigning to a local status variable looks much, much nicer here.
This commit is contained in:
parent
7c97696af9
commit
a7d8e52cc4
1 changed files with 11 additions and 9 deletions
|
|
@ -136,6 +136,7 @@ _cairo_path_count (cairo_path_t *path,
|
|||
double tolerance,
|
||||
cairo_bool_t flatten)
|
||||
{
|
||||
cairo_status_t status;
|
||||
cpc_t cpc;
|
||||
|
||||
cpc.count = 0;
|
||||
|
|
@ -143,15 +144,16 @@ _cairo_path_count (cairo_path_t *path,
|
|||
cpc.current_point.x = 0;
|
||||
cpc.current_point.y = 0;
|
||||
|
||||
if (_cairo_path_fixed_interpret (path_fixed,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cpc_move_to,
|
||||
_cpc_line_to,
|
||||
flatten ?
|
||||
_cpc_curve_to_flatten :
|
||||
_cpc_curve_to,
|
||||
_cpc_close_path,
|
||||
&cpc) != CAIRO_STATUS_SUCCESS)
|
||||
status = _cairo_path_fixed_interpret (path_fixed,
|
||||
CAIRO_DIRECTION_FORWARD,
|
||||
_cpc_move_to,
|
||||
_cpc_line_to,
|
||||
flatten ?
|
||||
_cpc_curve_to_flatten :
|
||||
_cpc_curve_to,
|
||||
_cpc_close_path,
|
||||
&cpc);
|
||||
if (status)
|
||||
return 0;
|
||||
|
||||
return cpc.count;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue