mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-26 11:10:11 +01:00
path: Skip calls to zero-length memcpy
We attempt to copy 0 points onto the array of path points for a close-path. This is pointless and an unnecessary function call under MSVC at least. Based on a patch by Steve Snyder, incorporating Behdad's review comments. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37836 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
f09361cff1
commit
1ce5d4707c
1 changed files with 3 additions and 0 deletions
|
|
@ -808,6 +808,9 @@ _cairo_path_buf_add_points (cairo_path_buf_t *buf,
|
|||
const cairo_point_t *points,
|
||||
int num_points)
|
||||
{
|
||||
if (buf->num_points == 0)
|
||||
return;
|
||||
|
||||
memcpy (buf->points + buf->num_points,
|
||||
points,
|
||||
sizeof (points[0]) * num_points);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue