From: Andrew Isherwood Date: Tue, 23 Apr 2019 09:09:33 +0000 (+0100) Subject: Bug 21460: Simplify the code to have only 1 assignment X-Git-Url: http://git.equinoxoli.org/?p=koha-equinox.git;a=commitdiff_plain;h=3255525b59fa0ecd728a3b5942db89a21ab52f43 Bug 21460: Simplify the code to have only 1 assignment Signed-off-by: Josef Moravec Signed-off-by: Nick Clemens --- diff --git a/Koha/REST/V1/Illrequests.pm b/Koha/REST/V1/Illrequests.pm index c3c51a5..f747390 100644 --- a/Koha/REST/V1/Illrequests.pm +++ b/Koha/REST/V1/Illrequests.pm @@ -56,14 +56,11 @@ sub list { # Get all requests # If necessary, only get those from a specified patron - my @requests; - if ($args->{borrowernumber}) { - @requests = Koha::Illrequests->search( - { borrowernumber => $args->{borrowernumber} } - ); - } else { - @requests = Koha::Illrequests->as_list; - } + my @requests = Koha::Illrequests->search({ + args->{borrowernumber} + ? ( borrowernumber => $args->{borrowernumber} ) + : () + })->as_list; # Identify patrons & branches that # we're going to need and get them