This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
remove PL_patchlevel from S_minus_v
authorDaniel Dragan <bulk88@hotmail.com>
Wed, 13 Nov 2013 04:07:16 +0000 (23:07 -0500)
committerTony Cook <tony@develop-help.com>
Wed, 20 Nov 2013 02:47:16 +0000 (13:47 +1100)
commit709aee9447f22f3f59d548d44298cca98a023f80
tree854fbbfc0b1f3663695a24fb10fc317e5df39cae
parentafda64e875a44be5497e50f703af44b9512fb61f
remove PL_patchlevel from S_minus_v

|SvPVX(vstringify(PL_patchlevel))| is the same string as
|"v" PERL_VERSION_STRING|. No need to go through the overhead of using a
version object. Instead of creating a SV, then further manipulating it.
Create and manipulate it at the same time with Perl_newSVpvf_nocontext or
newSVpvn. "num_len >= level_len " will be folded away by the compiler,
previously, since both lengths came from SVs, they were not const
technically. A very smart compiler might see strncmp/strnEQ takes all
const arguments, and will optimize that away also. VC 2003 didnt do that.
Change SvREFCNT_dec to SvREFCNT_dec_NN for obvious reasons.

There should not be any user visible changes to -v with this patch.
switches.t contains a regexp for -v already so no further tests were added.

This patch is part of #116296.
perl.c