summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-08-11 16:42:20 -0600
committerKarl Williamson <khw@cpan.org>2016-08-17 15:23:59 -0600
commit1065615957bc3821a00a319d54f18f443fc2861e (patch)
tree1e7974fe0057f8e62de957de28483f7b0ac94c72 /perl.c
parentcc890588b0ce25c7e37126933582b6d944ad1584 (diff)
downloadperl-1065615957bc3821a00a319d54f18f443fc2861e.tar.gz
Take advantage of SvGROW's return value
I had not realized that SvGROW returned the new string pointer. Using that makes a one-step process from a two-step process. I examined the code for other possible occurrences, and found others where it seemed that the two-step seemed clearer, so left those alone.
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/perl.c b/perl.c
index 21a8b30911..6618535741 100644
--- a/perl.c
+++ b/perl.c
@@ -3224,8 +3224,7 @@ Perl_moreswitches(pTHX_ const char *s)
s--;
}
PL_rs = newSVpvs("");
- SvGROW(PL_rs, (STRLEN)(UVCHR_SKIP(rschar) + 1));
- tmps = (U8*)SvPVX(PL_rs);
+ tmps = (U8*) SvGROW(PL_rs, (STRLEN)(UVCHR_SKIP(rschar) + 1));
uvchr_to_utf8(tmps, rschar);
SvCUR_set(PL_rs, UVCHR_SKIP(rschar));
SvUTF8_on(PL_rs);