Skip to content

Commit

Permalink
fix: Initialization of state variables in list context currently forb…
Browse files Browse the repository at this point in the history
…idden (perl version < 5.28) (#7058)

fix: Initialization of state variables in list context currently forbidden

Co-authored-by: off <off@openfoodfacts.org>
  • Loading branch information
stephanegigandet and off authored Jul 13, 2022
1 parent 7b1029b commit 44b9fc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ProductOpener/Display.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10152,7 +10152,7 @@ sub display_structured_response($request_ref) {
# Note: use "state" to avoid re-initializing the array. This can be seen as a premature optimisation
# here but this new perl feature can be used at other places to encapsulate large lists while avoiding
# inefficiencies from reinitialization.
state @product_fields_to_delete = ("languages", "category_properties", "categories_properties");
my @product_fields_to_delete = ("languages", "category_properties", "categories_properties");

remove_fields($request_ref->{structured_response}{product}, \@product_fields_to_delete);

Expand Down

0 comments on commit 44b9fc1

Please sign in to comment.