Prohibit map and grep in void context
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Tue, 31 Aug 2021 09:07:04 +0000 (11:07 +0200)
committerDaniel Gustafsson <dgustafsson@postgresql.org>
Tue, 31 Aug 2021 09:07:04 +0000 (11:07 +0200)
commitbb466c6b0992a1a21c03239a7b0a87ebadd3bee1
treeca337e27f75307637ab18311e0c733e03f517587
parentf2bbadce6b5052337a11a33ea6bd8d8aebe2610a
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
contrib/intarray/bench/create_test.pl
src/tools/perlcheck/perlcriticrc