limiting range of returned result to remove nulls
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 30 Jun 2006 20:19:52 +0000 (20:19 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 30 Jun 2006 20:19:52 +0000 (20:19 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@4873 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm

index 739c070..469cf06 100644 (file)
@@ -408,10 +408,13 @@ sub the_quest_for_knowledge {
                put_cache($ckey, \@recs);
 
                my @t;
-               push(@t, $recs[$_]) for ($offset..$end);
+               for ($offset..$end) {
+                       last if $end > scalar(@recs);
+                       push(@t, $recs[$_]) if $recs[$_];
+               }
                @recs = @t;
 
-               $logger->debug("cache done .. returning $offset..$end : " . JSON->perl2JSON(\@recs));
+               #$logger->debug("cache done .. returning $offset..$end : " . JSON->perl2JSON(\@recs));
        }
 
        return { ids => \@recs,