From 6af235a83934bbfdaba0d3147b2d5a849102a0c1 Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 26 Jan 2010 16:35:37 +0000 Subject: [PATCH] Dedup recs from open-ils.search.biblio.isbn_list. Consistent whitespace with the rest of Biblio.pm git-svn-id: svn://svn.open-ils.org/ILS/trunk@15387 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../OpenILS/Application/Search/Biblio.pm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm index 3c59a4ee56..0ef938b17c 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm @@ -1538,11 +1538,17 @@ __PACKAGE__->register_method( sub biblio_search_isbn_batch { my( $self, $client, $isbn_list ) = @_; $logger->debug("Searching ISBNs @$isbn_list"); - my $e = new_editor(); - my @recs = (); - @recs = ( @recs, @{ $U->storagereq( - 'open-ils.storage.id_list.biblio.record_entry.search.isbn.atomic', $_ ) - } ) for @$isbn_list; + my @recs = (); my %rec_set = (); + foreach my $isbn ( @$isbn_list ) { + foreach my $rec ( @{ $U->storagereq( + 'open-ils.storage.id_list.biblio.record_entry.search.isbn.atomic', $isbn ) + } ) { + if (! $rec_set{ $rec }) { + $rec_set{ $rec } = 1; + push @recs, $rec; + } + } + } return { ids => \@recs, count => scalar(@recs) }; } -- 2.43.2