From 88729370b2be3b8d422ff5bec23981f14394d614 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 --- 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.11.0