From: David Kamholz Date: Fri, 17 Mar 2006 08:38:09 +0000 (+0000) Subject: trivial optimization to MODIFY_CODE_ATTRIBUTES X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a58cd74bdd07f968d65ab67ffb95e7d76ed3dd75;p=dbsrgits%2FDBIx-Class-Historic.git trivial optimization to MODIFY_CODE_ATTRIBUTES --- diff --git a/lib/DBIx/Class.pm b/lib/DBIx/Class.pm index 864609b..0a0bce5 100644 --- a/lib/DBIx/Class.pm +++ b/lib/DBIx/Class.pm @@ -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 (); }