fix items with filters
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 25 May 2010 18:18:21 +0000 (20:18 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 25 May 2010 18:18:21 +0000 (20:18 +0200)
one optimization commited too quickly without testing with filters

lib/MojoFacets/Data.pm

index bf150ee..ca598a1 100644 (file)
@@ -450,8 +450,10 @@ sub items {
        foreach my $i ( 0 .. $#$sorted ) {
                my $pos = $sort_descending ? $sorted->[$i] : $sorted->[ $#$sorted - $i ];
 
-               push @filtered, $pos;
-               next if $#filter_names == -1;
+               if ( $#filter_names == -1 ) {
+                       push @filtered, $pos;
+                       next;
+               }
 
                my $skip = 0;
                foreach ( @filter_names ) {