diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-01-02 23:41:21 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-01-02 23:41:21 +0000 |
commit | 740cce10afff4bec3346f61ab3d0f7bfa424948c (patch) | |
tree | 83c031300e2326e8d8ae399e088c4d3a42472a13 /perl.c | |
parent | e350b669f3dadb9da757b62a20659cbc7eca2190 (diff) | |
download | perl-740cce10afff4bec3346f61ab3d0f7bfa424948c.tar.gz |
Add a new function newSVpvn_flags(), which takes a third parameter of
flag bits. Right now the only flag bit is SVf_UTF8, which will call
SvUTF8_on() on the new SV for you. Provide a wrapper newSVpvn_utf8(),
which takes a boolean, and passes in SVf_UTF8 if that is true.
Refactor the core to use it where possible. It makes the source code
clearer and smaller, but seems to be swings and roundabouts on object
code size.
p4raw-id: //depot/perl@32807
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -2481,8 +2481,7 @@ Perl_get_cvn_flags(pTHX_ const char *name, STRLEN len, I32 flags) * It has the same effect as "sub name;", i.e. just a forward * declaration! */ if ((flags & ~GV_NOADD_MASK) && !GvCVu(gv)) { - SV *const sv = newSVpvn(name,len); - SvFLAGS(sv) |= flags & SVf_UTF8; + SV *const sv = newSVpvn_flags(name, len, flags & SVf_UTF8); return newSUB(start_subparse(FALSE, 0), newSVOP(OP_CONST, 0, sv), NULL, NULL); |