From: Peter Rabbitson Date: Mon, 25 May 2009 15:45:33 +0000 (+0000) Subject: Too much logic for no benefit - always populate _virtual_order_by X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=79e2de1a991e42b80fcccb338eed16b4abb2bbbb;p=dbsrgits%2FDBIx-Class-Historic.git Too much logic for no benefit - always populate _virtual_order_by --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index e5ce095..5a8595c 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -746,26 +746,10 @@ sub single { # # This is a horrble hack, but seems like the best we can do at this point # Some limit emulations (Top) require an ordered resultset in order to -# function at all. So supply a PK order if such a condition is detected +# function at all. So supply a PK order to be used if necessary sub _gen_virtual_order { - my $self = shift; - my $attrs = $self->_resolved_attrs_copy; - - if ($attrs->{rows} or $attrs->{offset} ) { - -# This check requires ensure_connected, so probably cheaper to just calculate all the time - -# my $sm = $self->result_source->storage->_sql_maker; -# -# if ($sm->_default_limit_syntax eq 'Top' and not @{$sm->_resolve_order ($attrs->{order_by}) }) { - - return [ $self->result_source->primary_columns ]; - -# } - } - - return undef; + return [ shift->result_source->primary_columns ]; } # _is_unique_query