Bug 32528: Make safe_to_delete exit earlier on error conditions
This patch makes the `Koha::Item->safe_to_delete` method return right
after one of the checked conditions is met. This way we avoid further DB
queries and processing.
No behavior change is expected
To test:
1. Run:
$ kshell
k$ prove t/db_dependent/Koha/Item.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests STILL pass!
4. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 32528: Change return logic
Back to 1 return statement
Prevent the Koha::Result::Boolean instanciation duplication
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit
cc58ca2a3cc71d2af6b2342979ec310e89fec3a6)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>