Remove "scalar" call entirely17/head
authorTom Ryder <[email protected]>
Sat, 16 Dec 2017 01:09:16 +0000 (16 14:09 +1300)
committerTom Ryder <[email protected]>
Sat, 16 Dec 2017 01:09:16 +0000 (16 14:09 +1300)
Context with the lhs of the == operator forces this into scalar context
anyway, making this call redundant.

lib/Monitoring/Plugin/Getopt.pm

index 65c872f..c8033d0 100644 (file)
@@ -392,7 +392,7 @@ sub arg
   );
 
   # Named args
-  if (exists $params{$_[0]} && scalar @_ % 2 == 0) {
+  if (exists $params{$_[0]} && @_ % 2 == 0) {
     %args = validate( @_, \%params );
   }