the existing if/else construct was forcing the proximity call regardless of whether...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 5 Aug 2008 17:58:09 +0000 (17:58 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 5 Aug 2008 17:58:09 +0000 (17:58 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@10264 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index fa615ca..9282b58 100644 (file)
@@ -1179,10 +1179,11 @@ sub _check_title_hold_is_possible {
    my $home_org = $patron->home_ou;
    my $req_org = $request_lib->id;
 
-   my $home_prox = 
-      ($prox_cache{$home_org}) ? 
-         $prox_cache{$home_org} :
-         $prox_cache{$home_org} = $e->search_actor_org_unit_proximity({from_org => $home_org});
+    $prox_cache{$home_org} = 
+        $e->search_actor_org_unit_proximity({from_org => $home_org})
+        unless $prox_cache{$home_org};
+    my $home_prox = $prox_cache{$home_org};
+
 
    my %buckets;
    my %hash = map { ($_->to_org => $_->prox) } @$home_prox;
@@ -1197,10 +1198,11 @@ sub _check_title_hold_is_possible {
       # directly before the farthest away copies.  That way, they are not 
       # given priority, but they are checked before the farthest copies.
       # -----------------------------------------------------------------------
-      my $req_prox = 
-         ($prox_cache{$req_org}) ? 
-            $prox_cache{$req_org} :
-            $prox_cache{$req_org} = $e->search_actor_org_unit_proximity({from_org => $req_org});
+        $prox_cache{$req_org} = 
+            $e->search_actor_org_unit_proximity({from_org => $req_org})
+            unless $prox_cache{$req_org};
+        my $req_prox = $prox_cache{$req_org};
+
 
       my %buckets2;
       my %hash2 = map { ($_->to_org => $_->prox) } @$req_prox;