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:
Chris Wilson 2011-09-16 16:11:42 +01:00
parent f09361cff1
commit 1ce5d4707c

View file

@ -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);