diff options
author | Andy Lester <andy@petdance.com> | 2005-10-18 04:57:23 -0500 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-10-19 08:18:30 +0000 |
commit | 823a54a3e80592bb1d7f6b5fc487f84a3411e104 (patch) | |
tree | 31dcc1c257c61603a27ecb220a42a227ab753dd3 /hv.c | |
parent | d8c40edcf7b2eca3075e6c3cd36c64193c41e123 (diff) | |
download | perl-823a54a3e80592bb1d7f6b5fc487f84a3411e104.tar.gz |
More consting, and DRY leads to shrinking object code
Message-ID: <20051018145723.GA4964@petdance.com>
p4raw-id: //depot/perl@25803
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -879,13 +879,13 @@ Evaluates the hash in scalar context and returns the result. Handles magic when SV * Perl_hv_scalar(pTHX_ HV *hv) { - MAGIC *mg; SV *sv; - - if ((SvRMAGICAL(hv) && (mg = mg_find((SV*)hv, PERL_MAGIC_tied)))) { - sv = magic_scalarpack(hv, mg); - return sv; - } + + if (SvRMAGICAL(hv)) { + MAGIC * const mg = mg_find((SV*)hv, PERL_MAGIC_tied); + if (mg) + return magic_scalarpack(hv, mg); + } sv = sv_newmortal(); if (HvFILL((HV*)hv)) |