diff options
author | Daniel Gustafsson | 2021-08-31 09:07:04 +0000 |
---|---|---|
committer | Daniel Gustafsson | 2021-08-31 09:07:04 +0000 |
commit | bb466c6b0992a1a21c03239a7b0a87ebadd3bee1 (patch) | |
tree | ca337e27f75307637ab18311e0c733e03f517587 /contrib | |
parent | f2bbadce6b5052337a11a33ea6bd8d8aebe2610a (diff) |
Prohibit map and grep in void context
map and grep are not intended to be used as mutators, iterating
with side-effects should be done with for or foreach loops. This
fixes the one occurrence of the pattern, and bumps the perlcritic
policy to severity 5 for the map and grep policies.
Author: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Reviewed-by: Julien Rouhaud <rjuju123@gmail.com>
Discussion: https://postgr.es/m/87fsvzhhc4.fsf@wibble.ilmari.org
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/intarray/bench/create_test.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/intarray/bench/create_test.pl b/contrib/intarray/bench/create_test.pl index 993a4572f4..ae8d72bab0 100755 --- a/contrib/intarray/bench/create_test.pl +++ b/contrib/intarray/bench/create_test.pl @@ -51,7 +51,7 @@ foreach my $i (1 .. 200000) else { print $msg "$i\t{" . join(',', @sect) . "}\n"; - map { print $map "$i\t$_\n" } @sect; + print $map "$i\t$_\n" foreach @sect; } } close $map; |