Bug 30947: (follow-up) Remove unnecessary object cloning

CalcDateDue() works on its own copy of the $startdate parameter
so the cloning in the calling end is not necessary.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Joonas Kylmälä 2022-06-19 10:22:39 +00:00 committed by Tomas Cohen Arazi
parent 9b4b43656e
commit 7f60d88797
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 1 additions and 1 deletions

View File

@ -796,7 +796,7 @@ sub CanBookBeIssued {
my $circ_library = Koha::Libraries->find( _GetCircControlBranch($item_unblessed, $patron_unblessed) );
my $now = dt_from_string();
$duedate ||= CalcDateDue( $now->clone(), $effective_itemtype, $circ_library->branchcode, $patron_unblessed );
$duedate ||= CalcDateDue( $now, $effective_itemtype, $circ_library->branchcode, $patron_unblessed );
if (DateTime->compare($duedate,$now) == -1 ) { # duedate cannot be before now
$needsconfirmation{INVALID_DATE} = output_pref($duedate);
}