From: gfx Date: Sat, 9 Jan 2010 08:39:47 +0000 (+0900) Subject: Clean up mouse_tc_ScalarRef() X-Git-Tag: 0.46~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=bcf612a890fffe45537748b18a0ce6f881a028ea Clean up mouse_tc_ScalarRef() --- diff --git a/xs-src/MouseTypeConstraints.xs b/xs-src/MouseTypeConstraints.xs index a6e81ee..fb3ab4e 100644 --- a/xs-src/MouseTypeConstraints.xs +++ b/xs-src/MouseTypeConstraints.xs @@ -170,9 +170,13 @@ mouse_tc_Ref(pTHX_ SV* const data PERL_UNUSED_DECL, SV* const sv) { } int -mouse_tc_ScalarRef(pTHX_ SV* const data PERL_UNUSED_DECL, SV* const sv) { +mouse_tc_ScalarRef(pTHX_ SV* const data PERL_UNUSED_DECL, SV* sv) { assert(sv); - return SvROK(sv) && !SvOBJECT(SvRV(sv)) && (SvTYPE(SvRV(sv)) <= SVt_PVLV && !isGV(SvRV(sv))); + if(SvROK(sv)){ + sv = SvRV(sv); + return !SvOBJECT(sv) && (SvTYPE(sv) <= SVt_PVLV && !isGV(sv)); + } + return FALSE; } int