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 <rch@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
Clay Fouts 2008-09-18 14:40:05 -05:00 committed by Galen Charlton
parent c83bbcbffe
commit 53a403ee64
1 changed files with 3 additions and 3 deletions

View File

@ -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 );
}