From: gfx Date: Sat, 31 Oct 2009 04:47:11 +0000 (+0900) Subject: Remove duplicated checks X-Git-Tag: 0.40_04~24 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=76770976c9e76df52aeac5b171a0e9b62d127b38;p=gitmo%2FMouse.git Remove duplicated checks --- diff --git a/xs-src/MouseAccessor.xs b/xs-src/MouseAccessor.xs index e398c58..234e395 100644 --- a/xs-src/MouseAccessor.xs +++ b/xs-src/MouseAccessor.xs @@ -2,7 +2,7 @@ #define CHECK_INSTANCE(instance) STMT_START{ \ if(!(SvROK(instance) && SvTYPE(SvRV(instance)) == SVt_PVHV)){ \ - croak("Invalid object for instance managers"); \ + croak("Invalid object instance"); \ } \ } STMT_END @@ -62,11 +62,7 @@ mouse_accessor_get_self(pTHX_ I32 const ax, I32 const items, CV* const cv) { * before calling methods, so SvGETMAGIC(self) is not necessarily needed here. */ - self = ST(0); - if(!IsObject(self)){ - croak("Cant call %s as a class method", GvNAME(CvGV(cv))); - } - return self; + return ST(0); } @@ -475,7 +471,7 @@ XS(mouse_xs_simple_predicate) XSRETURN(1); } -/* simple instance slot accessor */ +/* simple instance slot accessor (or Mouse::Meta::Instance) */ SV* mouse_instance_create(pTHX_ HV* const stash) {