Bug 40919: Remove unnecessary DB call in Koha::Item::Transfer->receive

This patch removes a trivially not required DB object instantiation.
This implies saving CPU usage for the instantiation and algo for
fetching from the DB.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Item/Transfer.t
=> SUCCESS: Tests pass! They cover ->receive()
2. Apply this patch
3. Repeat 1
=> SUCCESS: No behavior change, tests pass!
4. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Tomás Cohen Arazi 2025-09-30 19:26:43 -03:00 committed by Lucas Gass
parent 88775c54bd
commit 9263bd4152
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 1 additions and 1 deletions

View File

@ -175,7 +175,7 @@ sub receive {
# Update the arrived date
$self->set( { datearrived => dt_from_string } )->store;
ModDateLastSeen( $self->item->itemnumber );
ModDateLastSeen( $self->itemnumber );
return $self;
}