summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-02-18 20:07:39 +0000
committerNicholas Clark <nick@ccl4.org>2007-02-18 20:07:39 +0000
commit7d0a29fec2f8bfc7e48abe23f1ebc308287c59c8 (patch)
tree64f184fb2e8d86f4b931facad02a62f37614b90c /toke.c
parentb9f83d2f7c4cb24d96302c6fcaa5e60628fad1f8 (diff)
downloadperl-7d0a29fec2f8bfc7e48abe23f1ebc308287c59c8.tar.gz
More efficient to call newSV_type() then SvGROW() instead of newSV()
with a size then sv_upgrade(), as the latter calls sv_upgrade() twice. p4raw-id: //depot/perl@30348
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/toke.c b/toke.c
index 7719aa537a..5248d46672 100644
--- a/toke.c
+++ b/toke.c
@@ -11149,8 +11149,8 @@ S_scan_heredoc(pTHX_ register char *s)
s--;
#endif
- tmpstr = newSV(79);
- sv_upgrade(tmpstr, SVt_PVIV);
+ tmpstr = newSV_type(SVt_PVIV);
+ SvGROW(tmpstr, 80);
if (term == '\'') {
op_type = OP_CONST;
SvIV_set(tmpstr, -1);
@@ -11555,8 +11555,8 @@ S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims)
/* create a new SV to hold the contents. 79 is the SV's initial length.
What a random number. */
- sv = newSV(79);
- sv_upgrade(sv, SVt_PVIV);
+ sv = newSV_type(SVt_PVIV);
+ SvGROW(sv, 80);
SvIV_set(sv, termcode);
(void)SvPOK_only(sv); /* validate pointer */