trivial optimization to MODIFY_CODE_ATTRIBUTES
David Kamholz [Fri, 17 Mar 2006 08:38:09 +0000 (08:38 +0000)]
lib/DBIx/Class.pm

index 864609b..0a0bce5 100644 (file)
@@ -17,10 +17,7 @@ $VERSION = '0.05999_04';
 
 sub MODIFY_CODE_ATTRIBUTES {
     my ($class,$code,@attrs) = @_;
-    unless ($class->can('__attr_cache')) {
-        $class->mk_classdata('__attr_cache');
-        $class->__attr_cache({});
-    }
+    $class->mk_classdata('__attr_cache' => {}) unless $class->can('__attr_cache');
     $class->__attr_cache->{$code} = [@attrs];
     return ();
 }