[Koha-bugs] [Bug 20212] Slowness in receiving in acquisitions

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jan 8 14:07:00 CET 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20212

--- Comment #126 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
123             if ( exists $reserved_params->{query} and defined
$reserved_params->{query} ) {          
124                 push @query_params_array, fix_query({ query =>
$reserved_params->{query} });         
125             }   
126             if ( exists $reserved_params->{q} and defined
$reserved_params->{q}) {                   
127                 push @query_params_array, fix_query({ query =>
decode_json($reserved_params->{q}) });
128             }   
129             if ( exists $reserved_params->{'x-koha-query'} and defined
$reserved_params->{'x-koha-query'} ) {     
130                 push @query_params_array, fix_query({ query =>
decode_json($reserved_params->{'x-koha-query'}) });;
131             }      

Cannot we replace it with a loop?

123             for my $q ( qw( query q x-koha-query ) ) {
124                 next unless exists $reserved_params->{$q} or defined
$reserved_params->{$q};
125                 push @query_params_array, fix_query({ query => decode_json
$reserved_params->{$q} }); 
126             }  

It's adding a decode_json for query, but I think it shouldn't hurt.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list