From 4322e8bf2ee7425c7a2c92c5cdd992e000c471f2 Mon Sep 17 00:00:00 2001 From: Clay Fouts Date: Thu, 18 Sep 2008 14:40:05 -0500 Subject: [PATCH] bug 2625 Using the barcode as an index for assigning values to an array creates problems if the numeric value of the barcode is sufficiently large to consume enough memory to starve other processes. This patch changes return_failed from an indexed array into an associative one, using the barcode as the key. Signed-off-by: Ryan Higgins Signed-off-by: Galen Charlton --- members/moremember.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/members/moremember.pl b/members/moremember.pl index 478969b099..065b1a5150 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -66,8 +66,8 @@ my @failedreturns = $input->param('failedreturn'); my $error = $input->param('error'); my @renew_failed; for my $renew (@failedrenews) { $renew_failed[$renew] = 1; } -my @return_failed; -for my $failedret (@failedreturns) { $return_failed[$failedret] = 1; } +my %return_failed; +for my $failedret (@failedreturns) { $return_failed{$failedret} = 1; } my $template_name; @@ -248,7 +248,7 @@ for ( my $i = 0 ; $i < $count ; $i++ ) { $row{'norenew'} = !$renewokay; $row{"norenew_reason_$renewerror"} = 1 if $renewerror; $row{'renew_failed'} = $renew_failed[$issue->[$i]{'itemnumber'}]; - $row{'return_failed'} = $return_failed[$issue->[$i]{'barcode'}]; + $row{'return_failed'} = $return_failed{$issue->[$i]{'barcode'}}; push( @issuedata, \%row ); } -- 2.39.5