projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9c4fdda
)
sv_clear only test for SvOBJECT on >= MG
author
David Mitchell
<davem@iabyn.com>
Thu, 19 May 2011 14:51:45 +0000
(15:51 +0100)
committer
David Mitchell
<davem@iabyn.com>
Thu, 19 May 2011 21:01:02 +0000
(22:01 +0100)
micro-optimisation
sv.c
patch
|
blob
|
history
diff --git
a/sv.c
b/sv.c
index
6efcc8f
..
b55d49d
100644
(file)
--- 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) {