The existing code has a fast path for copying a SVt_NULL or SVt_IV. For all
other types, a new SVt_NULL is passed into sv_setsv_flags, where it will
be upgraded into the required type by sv_upgrade().
This commit makes two changes:
1) Special case copying a SVt_NV where possible, as sv_setsv_flags does.
2) It's safe and more efficient to directly create a new type of SVt_PVNV
or below, rather than upgrade it later, so do that.
The existing code has a fast path for copying a
SVt_NULL
orSVt_IV
. For all other types, a newSVt_NULL
is passed intosv_setsv_flags
, where it will be upgraded into the required type bysv_upgrade()
.This commit makes two changes: 1) Special case copying a
SVt_NV
where possible, assv_setsv_flags
does. 2) It's safe and more efficient to directly create a new type ofSVt_PVNV
or below, rather than upgrade it later, so do that.