summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2005-10-18 04:57:23 -0500
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-10-19 08:18:30 +0000
commit823a54a3e80592bb1d7f6b5fc487f84a3411e104 (patch)
tree31dcc1c257c61603a27ecb220a42a227ab753dd3 /hv.c
parentd8c40edcf7b2eca3075e6c3cd36c64193c41e123 (diff)
downloadperl-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.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hv.c b/hv.c
index 8b41f77f21..9b90df25a0 100644
--- a/hv.c
+++ b/hv.c
@@ -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))