[Koha-patches] [PATCH] bug 2625
Clay Fouts
clay.fouts at liblime.com
Thu Sep 18 22:20:01 CEST 2008
As an addendum, this can be applied to 3.0 and 3.2 branches as it affects both.
Clay
On Thu, Sep 18, 2008 at 3:40 PM, Ryan Higgins <rch at liblime.com> wrote:
> From: Clay Fouts <clay.fouts at liblime.com>
>
> 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 at liblime.com>
> ---
> members/moremember.pl | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/members/moremember.pl b/members/moremember.pl
> index 87a5659..5eff58a 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 );
> }
>
> --
> 1.5.5.GIT
>
>
More information about the Koha-patches
mailing list