From 14d53117943f4a151ad47de1112e8fb92efd23b9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 17 Jul 2017 13:48:17 -0300 Subject: [PATCH] Bug 18942: Simplify syntax Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- C4/Budgets.pm | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/C4/Budgets.pm b/C4/Budgets.pm index 05f7ca5640..bcc84db83a 100644 --- a/C4/Budgets.pm +++ b/C4/Budgets.pm @@ -917,11 +917,8 @@ sub CanUserUseBudget { if (not ref $borrower) { $borrower = Koha::Patrons->find( $borrower ); - if ( $borrower ) { - $borrower = $borrower->unblessed; - } else { - return 0; - } + return 0 unless $borrower; + $borrower = $borrower->unblessed; } if (not ref $budget) { $budget = GetBudget($budget); @@ -1005,11 +1002,8 @@ sub CanUserModifyBudget { if (not ref $borrower) { $borrower = Koha::Patrons->find( $borrower ); - if ( $borrower ) { - $borrower = $borrower->unblessed; - } else { - return 0; - } + return 0 unless $borrower; + $borrower = $borrower->unblessed; } if (not ref $budget) { $budget = GetBudget($budget); -- 2.39.5