From: Matt S Trout Date: Sun, 17 Nov 2013 02:52:39 +0000 (+0000) Subject: maintain condition order (left versus right) in _stack_cond X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a8b2b652c8f930ee1c45e72639ec6e57b2c7ddcd;p=dbsrgits%2FDBIx-Class.git maintain condition order (left versus right) in _stack_cond --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 4ff25f7..e329034 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -600,9 +600,11 @@ sub _stack_cond { return undef unless @top; - my %top = map +(Data::Dumper::Concise::Dumper($_) => $_), @top; + my %seen; - return \Operator({ 'SQL.Naive' => 'AND' }, [ values %top ]); + my @uniq = grep { !$seen{Data::Dumper::Concise::Dumper($_)}++ } @top; + + return \Operator({ 'SQL.Naive' => 'AND' }, \@uniq); } =head2 search_literal