X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRow.pm;h=51b532519c3d8d0237a13bde7a0e9748096c40d6;hp=c59f70a319874e489ac6c0fab6e08be8001b57ac;hb=2d0b795a54a018d5c9cf2593cf83045962cd9b93;hpb=4e9fc3f33df616fb7340d05e304ff985b9cce9cb diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index c59f70a..51b5325 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -1140,15 +1140,9 @@ sub inflate_result { foreach my $pre (keys %{$prefetch||{}}) { my @pre_vals; - if (! @{$prefetch->{$pre}}) { - # nothing, empty @pre_vals is put in the caches - } - elsif (ref $prefetch->{$pre}[0] eq 'ARRAY') { - @pre_vals = @{$prefetch->{$pre}}; - } - else { - @pre_vals = $prefetch->{$pre}; - } + @pre_vals = (ref $prefetch->{$pre}[0] eq 'ARRAY') + ? @{$prefetch->{$pre}} : $prefetch->{$pre} + if @{$prefetch->{$pre}}; my $pre_source = $source->related_source($pre); @@ -1160,7 +1154,8 @@ sub inflate_result { # FIXME SUBOPTIMAL - the new row parsers can very well optimize # this away entirely, and *never* return such empty rows. - # For now we maintain inflate_result API backcompat + # For now we maintain inflate_result API backcompat, see + # t/resultset/inflate_result_api.t next unless first { defined $_ } values %{$me_pref->[0]}; push @pre_objects, $pre_source->result_class->inflate_result(