changed the list of seen copies to a hash based on copy id
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 22 Jan 2007 18:15:23 +0000 (18:15 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 22 Jan 2007 18:15:23 +0000 (18:15 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6799 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm

index 481da6e..fee7daa 100644 (file)
@@ -1173,7 +1173,7 @@ sub _check_title_hold_is_possible {
    @keys = sort { $a <=> $b } keys %buckets;
 
    my $title;
-   my @seen;
+   my %seen;
    for my $key (@keys) {
       my @cps = @{$buckets{$key}};
 
@@ -1181,8 +1181,8 @@ sub _check_title_hold_is_possible {
 
       for my $copy (@cps) {
 
-         next if grep { $_ eq $copy->id } @seen;
-         push(@seen, $copy->id); # there could be dupes given the merged buckets
+         next if $seen{$copy->id};
+         $seen{$copy->id} = 1; # there could be dupes given the merged buckets
          $logger->debug("looking at bucket_key=$key, copy ".$copy->id." : circ_lib = " . $copy->circ_lib);
 
          unless($title) { # grab the title if we don't already have it