From: Peter Rabbitson Date: Thu, 13 Jan 2011 11:24:47 +0000 (+0100) Subject: Remove some accumulated cruft X-Git-Tag: v0.08127~22 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=commitdiff_plain;h=48e4eac60b37de39a225264ab16f316c407f5740 Remove some accumulated cruft --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 4b5db45..5c862e3 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -206,22 +206,18 @@ sub new { $attrs->{alias} ||= 'me'; - # Creation of {} and bless separated to mitigate RH perl bug - # see https://bugzilla.redhat.com/show_bug.cgi?id=196836 - my $self = { + my $self = bless { result_source => $source, cond => $attrs->{where}, pager => undef, attrs => $attrs, - }; - - bless $self, $class; + }, $class; $self->result_class( $attrs->{result_class} || $source->result_class ); - return $self; + $self; } =head2 search diff --git a/lib/DBIx/Class/ResultSourceHandle.pm b/lib/DBIx/Class/ResultSourceHandle.pm index a878613..0c7e4db 100644 --- a/lib/DBIx/Class/ResultSourceHandle.pm +++ b/lib/DBIx/Class/ResultSourceHandle.pm @@ -12,8 +12,6 @@ use Try::Tiny; use namespace::clean; use overload - # on some RH perls the following line causes serious performance problem - # see https://bugzilla.redhat.com/show_bug.cgi?id=196836 q/""/ => sub { __PACKAGE__ . ":" . shift->source_moniker; }, fallback => 1; diff --git a/t/52leaks.t b/t/52leaks.t index e7052d5..f6b5ddb 100644 --- a/t/52leaks.t +++ b/t/52leaks.t @@ -237,8 +237,8 @@ for my $slot (keys %$weak_registry) { unless $cleared->{hash_merge_singleton}{$weak_registry->{$slot}{weakref}{behavior}}++; } elsif ($slot =~ /^__TxnScopeGuard__FIXUP__/) { - die 'The $@ debacle should have been fixed by now!!!' if $] >= 5.013008; - delete $weak_registry->{$slot}; + delete $weak_registry->{$slot} + if $] > 5.013001 and $] < 5.013008; } } @@ -260,7 +260,7 @@ $_->result_source_instance(undef) for ( DBICTest::Schema->source_registrations(undef); my $tb = Test::More->builder; -for my $slot (keys %$weak_registry) { +for my $slot (sort keys %$weak_registry) { ok (! defined $weak_registry->{$slot}{weakref}, "No leaks of $slot") or do { my $diag = '';