From 5999854272b94e73cecdb1bec6d69670b0962394 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 12 Nov 2014 12:23:38 +0100 Subject: [PATCH] Bug 13240: Remove some code obfuscation Content-Type: text/plain; charset=utf-8 my $bar; my $foo = $bar->{borrowernumber} ||= {}; $foo->{one} ||= 'something'; $foo->{two}++; What does $bar contain? $VAR1 = { 'borrowernumber' => { 'two' => 1, 'bar' => 'something' } }; Not really obvious. Maybe something I did not see is hidden. Test plan: Verify the digest for DUE and PREDUE work as before. Signed-off-by: Marcel de Rooy --- misc/cronjobs/advance_notices.pl | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl index 26f87ae..edcaee7 100755 --- a/misc/cronjobs/advance_notices.pl +++ b/misc/cronjobs/advance_notices.pl @@ -242,9 +242,8 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { if ( $borrower_preferences->{'wants_digest'} ) { # cache this one to process after we've run through all of the items. - my $digest = $due_digest->{$upcoming->{'borrowernumber'}} ||= {}; - $digest->{email} ||= $from_address; - $digest->{count}++; + $due_digest->{$upcoming->{borrowernumber}}{email} = $from_address; + $due_digest->{$upcoming->{borrowernumber}}{count}++; } else { my $biblio = C4::Biblio::GetBiblioFromItemNumber( $upcoming->{'itemnumber'} ); my $letter_type = 'DUE'; @@ -278,9 +277,8 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { if ( $borrower_preferences->{'wants_digest'} ) { # cache this one to process after we've run through all of the items. - my $digest = $upcoming_digest->{$upcoming->{'borrowernumber'}} ||= {}; - $digest->{email} ||= $from_address; - $digest->{count}++; + $upcoming_digest->{$upcoming->{borrowernumber}}{email} = $from_address; + $upcoming_digest->{$upcoming->{borrowernumber}}{count}++; } else { my $biblio = C4::Biblio::GetBiblioFromItemNumber( $upcoming->{'itemnumber'} ); my $letter_type = 'PREDUE'; -- 1.7.7.6