From 53bc8d9ee3d9b1f405b17dc4b7200a601d52083d Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Mon, 13 Jan 2020 15:16:20 +0100
Subject: [PATCH] Bug 24366: Improve hashref construction

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
---
 Koha/Biblio.pm | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm
index 5efc462e03..e503bad718 100644
--- a/Koha/Biblio.pm
+++ b/Koha/Biblio.pm
@@ -740,11 +740,7 @@ sub to_api {
     my $response = $self->SUPER::to_api( $args );
     my $biblioitem = $self->biblioitem->to_api( $args );
 
-    foreach my $key ( keys %{ $biblioitem } ) {
-        $response->{$key} = $biblioitem->{$key};
-    }
-
-    return $response;
+    return { %$response, %$biblioitem };
 }
 
 =head3 to_api_mapping
-- 
2.11.0