[monitoring-plugin-perl] Pass params validation by ref not copy
Tom Ryder <[email protected]> Fri, 22 Dec 2017 11:50:07 +0100 (CET)
| Newsgroups | gmane.network.nagios.cvs |
|---|---|
| Message-ID | <20171222105007.6BA1C200846E__4658.58718748695$1513939702$gmane$org@orwell.monitoring-plugins.org> |
Module: monitoring-plugin-perl Branch: master Commit: 6518f384cc20561ddc0df32414a714164dd2eb95 Author: Tom Ryder <[email protected]> Date: Sat Dec 16 13:34:38 2017 +1300 URL: https://www.monitoring-plugins.org/repositories/monitoring-plugin-perl/commit/?id=6518f38 Pass params validation by ref not copy Since Params::Validate::validate() doesn't seem to actually mess with this specification, may as well pass a reference rather than bother copying the whole thing. --- lib/Monitoring/Plugin/Getopt.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Monitoring/Plugin/Getopt.pm b/lib/Monitoring/Plugin/Getopt.pm index b5a9ab4..65c872f 100644 --- a/lib/Monitoring/Plugin/Getopt.pm +++ b/lib/Monitoring/Plugin/Getopt.pm @@ -393,7 +393,7 @@ sub arg # Named args if (exists $params{$_[0]} && scalar @_ % 2 == 0) { - %args = validate( @_, { %params }); + %args = validate( @_, \%params ); } # Positional args