summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-10-06 12:55:29 +0000
committerNicholas Clark <nick@ccl4.org>2007-10-06 12:55:29 +0000
commite524fe407db4cb29ab7ae7ba25321a418c897171 (patch)
treef784f572e68338ccda0efb6993d1b8ce3b8703bd /utf8.c
parent53ce71d37f27a80bc42faba5c56ff7a3580a11f8 (diff)
downloadperl-e524fe407db4cb29ab7ae7ba25321a418c897171.tar.gz
newSV(size) and SvPOK_on() will be more efficient than newSVpvs("")
followed by SvGROW(size+1) p4raw-id: //depot/perl@32045
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/utf8.c b/utf8.c
index 45b17b1b62..e9e14fc6c3 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;