X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xs-src%2FMouseTypeConstraints.xs;h=fb8a5213fcb9823d00c8a5bfdf326b0e795a6d65;hb=a901dc2e35564c80a917b1a7dbe3ca9d968770c4;hp=605c9237378da215bfdb6d953ea66a794b864306;hpb=fc83f4cf2ef7708120a216bddc285b93082d7958;p=gitmo%2FMouse.git diff --git a/xs-src/MouseTypeConstraints.xs b/xs-src/MouseTypeConstraints.xs index 605c923..fb8a521 100644 --- a/xs-src/MouseTypeConstraints.xs +++ b/xs-src/MouseTypeConstraints.xs @@ -24,13 +24,13 @@ mouse_tc_check(pTHX_ SV* const tc_code, SV* const sv) { CV* const cv = (CV*)SvRV(tc_code); assert(SvTYPE(cv) == SVt_PVCV); - SvGETMAGIC(sv); if(CvXSUB(cv) == XS_Mouse_constraint_check){ /* built-in type constraints */ MAGIC* const mg = (MAGIC*)CvXSUBANY(cv).any_ptr; assert(CvXSUBANY(cv).any_ptr != NULL); assert(mg->mg_ptr != NULL); + SvGETMAGIC(sv); /* call the check function directly, skipping call_sv() */ return CALL_FPTR((check_fptr_t)mg->mg_ptr)(aTHX_ mg->mg_obj, sv); } @@ -530,10 +530,7 @@ mouse_generate_can_predicate_for(pTHX_ SV* const methods, const char* const pred I32 len; I32 i; - SvGETMAGIC(methods); - if(!IsArrayRef(methods)){ - croak("You must pass an ARRAY ref method names"); - } + must_ref(methods, "an ARRAY ref for method names", SVt_PVAV); av = (AV*)SvRV(methods); len = av_len(av) + 1;