From: Nicholas Clark Date: Sat, 6 Oct 2007 12:55:29 +0000 (+0000) Subject: newSV(size) and SvPOK_on() will be more efficient than newSVpvs("") X-Git-Tag: accepted/trunk/20130322.191538~14444 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e524fe407db4cb29ab7ae7ba25321a418c897171;p=platform%2Fupstream%2Fperl.git newSV(size) and SvPOK_on() will be more efficient than newSVpvs("") followed by SvGROW(size+1) p4raw-id: //depot/perl@32045 --- diff --git a/utf8.c b/utf8.c index 45b17b1..e9e14fc 100644 --- a/utf8.c +++ b/utf8.c @@ -1774,9 +1774,9 @@ S_swash_get(pTHX_ SV* swash, UV start, UV span) } /* create and initialize $swatch */ - swatch = newSVpvs(""); scur = octets ? (span * octets) : (span + 7) / 8; - SvGROW(swatch, scur + 1); + swatch = newSV(scur); + SvPOK_on(swatch); s = (U8*)SvPVX(swatch); if (octets && none) { const U8* const e = s + scur;