[cairo] Use hb_swap()

This commit is contained in:
Behdad Esfahbod 2023-01-25 14:54:52 -07:00
parent 5e86870378
commit a9392c0cbb
1 changed files with 2 additions and 8 deletions

View File

@ -594,16 +594,10 @@ _hb_cairo_add_sweep_gradient_patches (hb_color_stop_t *stops,
/* handle directions */ /* handle directions */
if (end_angle < start_angle) if (end_angle < start_angle)
{ {
float angle = end_angle; hb_swap (start_angle, end_angle);
end_angle = start_angle;
start_angle = angle;
for (unsigned i = 0; i < n_stops - 1 - i; i++) for (unsigned i = 0; i < n_stops - 1 - i; i++)
{ hb_swap (stops[i], stops[n_stops - 1 - i]);
hb_color_stop_t stop = stops[i];
stops[i] = stops[n_stops - 1 - i];
stops[n_stops - 1 - i] = stop;
}
} }
if (n_stops > PREALLOCATED_COLOR_STOPS) if (n_stops > PREALLOCATED_COLOR_STOPS)