Bug 24185: Make holds page faster - Improved "if"

`$can_item_be_reserved eq 'OK'` moved in `&&` before `IsAvailableForItemLevelRequest`
to cut away with static known values before calling to more resource consuming subroutine.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Andrew Nugged 2019-12-19 18:16:33 +02:00 committed by Martin Renvoize
parent a0b8805ce3
commit 7ecd21a1e4
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 1 additions and 1 deletions

View File

@ -557,8 +557,8 @@ foreach my $biblionumber (@biblionumbers) {
if (
!$item->{cantreserve}
&& !$exceeded_maxreserves
&& IsAvailableForItemLevelRequest($item_object, $patron)
&& $can_item_be_reserved eq 'OK'
&& IsAvailableForItemLevelRequest($item_object, $patron)
)
{
$item->{available} = 1;