diff options
author | Richard Leach <richardleach@users.noreply.github.com> | 2022-02-09 21:53:55 +0000 |
---|---|---|
committer | xenu <me@xenu.pl> | 2022-03-07 01:08:53 +0100 |
commit | 8fcb24256a3027cbca7c100825eb3805586fe1e5 (patch) | |
tree | ef13c018bfdbee1dc73b5d38efdedd78614db471 /toke.c | |
parent | 75acd14e43f2ffb698fc7032498f31095b56adb5 (diff) | |
download | perl-8fcb24256a3027cbca7c100825eb3805586fe1e5.tar.gz |
Inlined newSV_type(SVt_NULL) leaner than non-inlined newSV(0)
When a function outside of sv.c creates a SV via newSV(0):
* There is a call to Perl_newSV
* A SV head is uprooted and its flags set
* A runtime check is made to effectively see if 0 > 0
* The new SV* is returned
Replacing newSV(0) with newSV_type(SVt_NULL) should be more efficient,
because (assuming there are SV heads to uproot), the only step is:
* A SV head is uprooted and its flags set
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2382,7 +2382,7 @@ S_force_strict_version(pTHX_ char *s) s++; if (is_STRICT_VERSION(s,&errstr)) { - SV *ver = newSV(0); + SV *ver = newSV_type(SVt_NULL); s = (char *)scan_version(s, ver, 0); version = newSVOP(OP_CONST, 0, ver); } |