From: Brandon L. Black Date: Tue, 1 May 2007 05:25:33 +0000 (+0000) Subject: load-time performance improvements X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5c46030a7370735495c2bc790da6be9611e910a4;p=dbsrgits%2FDBIx-Class-Historic.git load-time performance improvements --- diff --git a/lib/DBIx/Class/Componentised.pm b/lib/DBIx/Class/Componentised.pm index 2b3bf83..01ca4db 100644 --- a/lib/DBIx/Class/Componentised.pm +++ b/lib/DBIx/Class/Componentised.pm @@ -33,8 +33,7 @@ sub inject_base { # it on the basis of the comments in Class::C3, the author was on #dbix-class # while I was implementing this. - my $table = { Class::C3::_dump_MRO_table }; - eval "package $target; import Class::C3;" unless exists $table->{$target}; + eval "package $target; import Class::C3;" unless exists $Class::C3::MRO{$target}; } sub load_components { diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 3ab14fd..5f69862 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -91,15 +91,11 @@ moniker. sub register_source { my ($self, $moniker, $source) = @_; - my %reg = %{$self->source_registrations}; - $reg{$moniker} = $source; - $self->source_registrations(\%reg); + $self->source_registrations->{$moniker} = $source; $source->schema($self); weaken($source->{schema}) if ref($self); if ($source->result_class) { - my %map = %{$self->class_mappings}; - $map{$source->result_class} = $moniker; - $self->class_mappings(\%map); + $self->class_mappings->{$source->result_class} = $moniker; } } @@ -389,9 +385,6 @@ will produce the output sub compose_namespace { my ($self, $target, $base) = @_; - my %reg = %{ $self->source_registrations }; - my %target; - my %map; my $schema = $self->clone; { no warnings qw/redefine/;