summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2011-05-19 15:51:45 +0100
committerDavid Mitchell <davem@iabyn.com>2011-05-19 22:01:02 +0100
commit683f70bd434f9fbb4bf674c5b6c54890109c04ab (patch)
tree04d527053def9d2f5ae8482f2dcaceb14ef767f3 /sv.c
parent9c4fdda15e362ce5accd8f03629d2bbb7bb40027 (diff)
downloadperl-683f70bd434f9fbb4bf674c5b6c54890109c04ab.tar.gz
sv_clear only test for SvOBJECT on >= MG
micro-optimisation
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sv.c b/sv.c
index 6efcc8fc08..b55d49db3e 100644
--- a/sv.c
+++ b/sv.c
@@ -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) {