X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBIHacks.pm;h=10be9124af59f7a90b7976ccb0bafa495a449aea;hb=6298a324307439b76419d0f5db453b0d10f10517;hp=f16c9355a2dac8be1c6ca9ba5e2e123bf8e48f38;hpb=4edfce2f91ce49d56ea11eb7710600b3fe5b96c5;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBIHacks.pm b/lib/DBIx/Class/Storage/DBIHacks.pm index f16c935..10be912 100644 --- a/lib/DBIx/Class/Storage/DBIHacks.pm +++ b/lib/DBIx/Class/Storage/DBIHacks.pm @@ -14,6 +14,9 @@ use base 'DBIx::Class::Storage'; use mro 'c3'; use Carp::Clan qw/^DBIx::Class/; +use List::Util 'first'; +use Scalar::Util 'blessed'; +use namespace::clean; # # This code will remove non-selecting/non-restricting joins from @@ -105,10 +108,7 @@ sub _adjust_select_args_for_complex_prefetch { # if a multi-type join was needed in the subquery - add a group_by to simulate the # collapse in the subq $inner_attrs->{group_by} ||= $inner_select - if List::Util::first - { ! $_->[0]{-is_single} } - (@{$inner_from}[1 .. $#$inner_from]) - ; + if first { ! $_->[0]{-is_single} } (@{$inner_from}[1 .. $#$inner_from]); # generate the subquery my $subq = $self->_select_args_to_query ( @@ -324,7 +324,7 @@ sub _resolve_ident_sources { # the reason this is so contrived is that $ident may be a {from} # structure, specifying multiple tables to join - if ( Scalar::Util::blessed($ident) && $ident->isa("DBIx::Class::ResultSource") ) { + if ( blessed $ident && $ident->isa("DBIx::Class::ResultSource") ) { # this is compat mode for insert/update/delete which do not deal with aliases $alias2source->{me} = $ident; $rs_alias = 'me';