]> git.koha-community.org Git - koha.git/commit
Bug 24185: Make holds page faster: Preparatory refactoring
authorAndrew Nugged <nugged@gmail.com>
Tue, 14 Jan 2020 20:51:57 +0000 (22:51 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 25 Mar 2020 09:40:39 +0000 (09:40 +0000)
commitd3a37911cfbddfa99f50d06e9c423a4a05e89557
treee19e7f7d100383e9106949af6c4907f8db24bdd0
parentedef63e5a890a80d4cd9b02a4b6cbd7fe3d72890
Bug 24185: Make holds page faster: Preparatory refactoring

This is just refactoring. extracting logically independent code
to separate sub + tests update. No logic change yet.

Searching for "any_available" item among all biblionumber items was done
inside of "elsif on_shelf_holds == 2", and it is logically very independent
piece of code (this "@items" loop), it needs just biblionumber and patron
as parameters so it can be extracted into separate subroutine, and
later also called/reused from somewhere else.

This ability to call from another place also made for future patch
to remove O(n^2) problem with nested loops.

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>
C4/Reserves.pm
t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t