Optimize away always-true hold count clause
authorMike Rylander <mrylander@gmail.com>
Tue, 16 Jul 2013 20:58:57 +0000 (16:58 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 17 Jul 2013 17:53:46 +0000 (13:53 -0400)
commit0aa79fe3f10b8b2c235167b69d9ce72018ef4349
tree5787bd436a537241cd66f9f0dcc2839263fed6de
parent514f5db19fe344bd2dde184a8c96f875ec2e1b88
Optimize away always-true hold count clause

When rendering results in the tpac we request hold counts for each record.
Most of the time (that is, whenever org unit hiding is /not/ in use) we
filter, essentially, on "where pickup_lib is in the org tree".  This is
both useless and slow, so this commit will recognize that and optimize the
test away.

[LFW: fixed typo]

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm