diff options
author | David Mitchell <davem@iabyn.com> | 2011-05-19 15:51:45 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2011-05-19 22:01:02 +0100 |
commit | 683f70bd434f9fbb4bf674c5b6c54890109c04ab (patch) | |
tree | 04d527053def9d2f5ae8482f2dcaceb14ef767f3 /sv.c | |
parent | 9c4fdda15e362ce5accd8f03629d2bbb7bb40027 (diff) | |
download | perl-683f70bd434f9fbb4bf674c5b6c54890109c04ab.tar.gz |
sv_clear only test for SvOBJECT on >= MG
micro-optimisation
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -6049,10 +6049,12 @@ Perl_sv_clear(pTHX_ SV *const orig_sv) goto free_head; } - if (SvOBJECT(sv)) { - if (!curse(sv, 1)) goto get_next_sv; - } + assert(!SvOBJECT(sv) || type >= SVt_PVMG); /* objs are always >= MG */ + if (type >= SVt_PVMG) { + if (SvOBJECT(sv)) { + if (!curse(sv, 1)) goto get_next_sv; + } /* Free back-references before magic, in case the magic calls * Perl code that has weak references to sv. */ if (type == SVt_PVHV) { |