[Bast-commits] r3220 - trunk/DBIx-Class/lib/DBIx/Class
blblack at dev.catalyst.perl.org
blblack at dev.catalyst.perl.org
Tue May 1 06:25:34 GMT 2007
Author: blblack
Date: 2007-05-01 06:25:33 +0100 (Tue, 01 May 2007)
New Revision: 3220
Modified:
trunk/DBIx-Class/lib/DBIx/Class/Componentised.pm
trunk/DBIx-Class/lib/DBIx/Class/Schema.pm
Log:
load-time performance improvements
Modified: trunk/DBIx-Class/lib/DBIx/Class/Componentised.pm
===================================================================
--- trunk/DBIx-Class/lib/DBIx/Class/Componentised.pm 2007-04-30 09:15:23 UTC (rev 3219)
+++ trunk/DBIx-Class/lib/DBIx/Class/Componentised.pm 2007-05-01 05:25:33 UTC (rev 3220)
@@ -33,8 +33,7 @@
# 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 {
Modified: trunk/DBIx-Class/lib/DBIx/Class/Schema.pm
===================================================================
--- trunk/DBIx-Class/lib/DBIx/Class/Schema.pm 2007-04-30 09:15:23 UTC (rev 3219)
+++ trunk/DBIx-Class/lib/DBIx/Class/Schema.pm 2007-05-01 05:25:33 UTC (rev 3220)
@@ -91,15 +91,11 @@
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 @@
sub compose_namespace {
my ($self, $target, $base) = @_;
- my %reg = %{ $self->source_registrations };
- my %target;
- my %map;
my $schema = $self->clone;
{
no warnings qw/redefine/;
More information about the Bast-commits
mailing list