Refactor how prehashed hash keys work.
[gitmo/Class-MOP.git] / xs / Attribute.xs
index 807e7e5..150fd05 100644 (file)
@@ -1,7 +1,5 @@
 #include "mop.h"
 
-NEEDS_KEY(name);
-
 MODULE = Class::MOP::Attribute   PACKAGE = Class::MOP::Attribute
 
 PROTOTYPES: DISABLE
@@ -16,7 +14,7 @@ name(self)
             die("Cannot call name as a class method");
         }
 
-        if ( (he = hv_fetch_ent((HV *)SvRV(self), key_name, 0, hash_name)) )
+        if ( (he = hv_fetch_ent((HV *)SvRV(self), KEY_FOR(name), 0, HASH_FOR(name))) )
             XPUSHs(HeVAL(he));
         else
             ST(0) = &PL_sv_undef;