From 706d7d271a3e01f03fc8d2477ff03a1ef47b1c83 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 5 Aug 2008 17:58:09 +0000 Subject: [PATCH] the existing if/else construct was forcing the proximity call regardless of whether the cached value existed. changed and tested git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@10264 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/perlmods/OpenILS/Application/Circ/Holds.pm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm index fa615cabcc..9282b585b8 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm @@ -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; -- 2.11.0