[Koha-bugs] [Bug 32528] Koha::Item->safe_to_delete should short-circuit earlier
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Tue Jan 3 16:24:13 CET 2023
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32528
Jonathan Druart <jonathan.druart+koha at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #144847|0 |1
is obsolete| |
Attachment #144925|0 |1
is obsolete| |
--- Comment #10 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
Created attachment 144938
-->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144938&action=edit
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 at theke.io>
Signed-off-by: Nick Clemens <nick at 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 at bugs.koha-community.org>
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list