Use memset rather than a loop to set memory to a fixed value

This commit is contained in:
Paul Cornett 2019-02-02 11:01:05 -08:00
parent 28010b51f0
commit 5771b371f2

View File

@ -216,13 +216,10 @@ unsigned char *InitAlpha(wxImage *image, png_uint_32 x, png_uint_32 y)
// set alpha for the pixels we had so far
png_uint_32 end = y * image->GetWidth() + x;
for ( png_uint_32 i = 0; i < end; i++ )
{
// all the previous pixels were opaque
*alpha++ = 0xff;
}
// all the previous pixels were opaque
memset(alpha, 0xff, end);
return alpha;
return alpha + end;
}
// ----------------------------------------------------------------------------