From: Florian Ragwitz Date: Wed, 11 Mar 2009 04:59:27 +0000 (+0100) Subject: Make the logic easier to follow. X-Git-Tag: 0.78_01~63 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=38d91ddc1c9368f0771aed719aeff0269c0bea61;p=gitmo%2FClass-MOP.git Make the logic easier to follow. --- diff --git a/mop.c b/mop.c index ada6c0e..19b90bc 100644 --- a/mop.c +++ b/mop.c @@ -268,11 +268,11 @@ XS(mop_xs_simple_reader) croak("object is not a hashref"); } - if (!(he = hv_fetch_ent((HV *)SvRV(self), prehashed_keys[key].key, 0, prehashed_keys[key].hash))) { - ST(0) = &PL_sv_undef; + if ((he = hv_fetch_ent((HV *)SvRV(self), prehashed_keys[key].key, 0, prehashed_keys[key].hash))) { + ST(0) = HeVAL(he); } else { - ST(0) = HeVAL(he); + ST(0) = &PL_sv_undef; } XSRETURN(1);