X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xs%2FHasMethods.xs;h=e136abece9b71c944831785949fda6a27ed58294;hb=48ac876af2c1991bd6cdba0d54b775a121e01725;hp=0e617eb85156bec2d9f4bf7a283de73609ccef6c;hpb=38bf2a2585e26a47c919fd4c286b7716acb51c00;p=gitmo%2FMoose.git diff --git a/xs/HasMethods.xs b/xs/HasMethods.xs index 0e617eb..e136abe 100644 --- a/xs/HasMethods.xs +++ b/xs/HasMethods.xs @@ -5,7 +5,7 @@ SV *mop_associated_metaclass; SV *mop_wrap; static void -mop_update_method_map(pTHX_ SV *const self, SV *const class_name, HV *const stash, HV *const map) +mop_update_method_map(pTHX_ HV *const stash, HV *const map) { char *method_name; I32 method_name_len; @@ -37,8 +37,8 @@ mop_update_method_map(pTHX_ SV *const self, SV *const class_name, HV *const stas continue; } - /* $map->{$method_name} = undef */ - sv_setsv(method, &PL_sv_undef); + /* delete $map->{$method_name} */ + (void)hv_delete(map, method_name, method_name_len, G_DISCARD); } } @@ -74,7 +74,7 @@ _method_map(self) } if ( !SvOK(cache_flag) || SvUV(cache_flag) != current ) { - mop_update_method_map(aTHX_ self, class_name, stash, (HV *)SvRV(map_ref)); + mop_update_method_map(aTHX_ stash, (HV *)SvRV(map_ref)); sv_setuv(cache_flag, mop_check_package_cache_flag(aTHX_ stash)); /* update_cache_flag() */ }