From: Yuval Kogman Date: Thu, 21 Aug 2008 11:28:49 +0000 (+0000) Subject: checking count is not necessary with G_SCALAR when calling into perl space X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4ca2dd5f70b1375b4e819af9e3f21cce87eaea65;p=gitmo%2FMoose.git checking count is not necessary with G_SCALAR when calling into perl space --- diff --git a/Moose.xs b/Moose.xs index f59414d..84456b3 100644 --- a/Moose.xs +++ b/Moose.xs @@ -770,7 +770,6 @@ STATIC void delete_mi (pTHX_ MI *mi) { * $attr->associated_class->get_meta_instance */ STATIC SV *attr_to_meta_instance(pTHX_ SV *meta_attr) { dSP; - I32 count; SV *mi; if ( !meta_attr ) @@ -783,10 +782,7 @@ STATIC SV *attr_to_meta_instance(pTHX_ SV *meta_attr) { XPUSHs(meta_attr); PUTBACK; - count = call_pv("Moose::XS::attr_to_meta_instance", G_SCALAR); - - if ( count != 1 ) - croak("attr_to_meta_instance borked (%d args returned, expecting 1)", (int)count); + call_pv("Moose::XS::attr_to_meta_instance", G_SCALAR); SPAGAIN; mi = POPs; @@ -992,9 +988,9 @@ STATIC SV *call_builder (pTHX_ SV *self, ATTR *attr) { * $obj->$coderef etc, for that we need to use 'default' */ PUTBACK; call_method(SvPV_nolen(attr->def.sv), G_SCALAR); - SPAGAIN; /* the value is a mortal with a refcount of 1, so we need to keep it around */ + SPAGAIN; sv = POPs; SvREFCNT_inc_simple_void(sv);