From: gfx Date: Sat, 31 Oct 2009 06:40:11 +0000 (+0900) Subject: Tidy X-Git-Tag: 0.40_04~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=28ba5a267651519bd096e2e6ac43add4807a9b86;p=gitmo%2FMouse.git Tidy --- diff --git a/xs-src/MouseTypeConstraints.xs b/xs-src/MouseTypeConstraints.xs index 81d0811..41f70d7 100644 --- a/xs-src/MouseTypeConstraints.xs +++ b/xs-src/MouseTypeConstraints.xs @@ -18,10 +18,8 @@ typedef int (*check_fptr_t)(pTHX_ SV* const data, SV* const sv); int mouse_tc_check(pTHX_ SV* const tc_code, SV* const sv) { - CV* cv; - assert(SvROK(tc_code) && SvTYPE(SvRV(tc_code))); - - cv = (CV*)SvRV(tc_code); + CV* const cv = (CV*)SvRV(tc_code); + assert(SvTYPE(cv) == Svt_PVCV); if(CvISXSUB(cv)){ /* can be built-in tc */ if(CvXSUB(cv) == XS_Mouse__Util__TypeConstraints_Item){ @@ -33,7 +31,9 @@ mouse_tc_check(pTHX_ SV* const tc_code, SV* const sv) { MAGIC* const mg = (MAGIC*)CvXSUBANY(cv).any_ptr; assert(CvXSUBANY(cv).any_ptr != NULL); - return CALL_FPTR((check_fptr_t)mg->mg_ptr)(aTHX_ mg->mg_obj /* stash */, sv); + + /* call the check function directly, skipping call_sv() */ + return CALL_FPTR((check_fptr_t)mg->mg_ptr)(aTHX_ mg->mg_obj, sv); } }