Browse Source

Dpkg::Arch: Move argument unpacking to the beginning of functions

These get rid of few false positives from perlcritic.

Addresses Subroutines::RequireArgUnpacking.

Warned-by: perlcritic
Guillem Jover 12 years ago
parent
commit
231609a198
1 changed files with 6 additions and 6 deletions
  1. 6 6
      scripts/Dpkg/Arch.pm

+ 6 - 6
scripts/Dpkg/Arch.pm

@@ -252,11 +252,11 @@ sub read_triplettable()
 
 sub debtriplet_to_gnutriplet(@)
 {
+    my ($abi, $os, $cpu) = @_;
+
     read_cputable();
     read_ostable();
 
-    my ($abi, $os, $cpu) = @_;
-
     return unless defined($abi) && defined($os) && defined($cpu) &&
         exists($cputable{$cpu}) && exists($ostable{"$abi-$os"});
     return join('-', $cputable{$cpu}, $ostable{"$abi-$os"});
@@ -313,10 +313,10 @@ sub debarch_to_multiarch($)
 
 sub debtriplet_to_debarch(@)
 {
-    read_triplettable();
-
     my ($abi, $os, $cpu) = @_;
 
+    read_triplettable();
+
     if (!defined($abi) || !defined($os) || !defined($cpu)) {
 	return;
     } elsif (exists $debtriplet_to_debarch{"$abi-$os-$cpu"}) {
@@ -328,11 +328,11 @@ sub debtriplet_to_debarch(@)
 
 sub debarch_to_debtriplet($)
 {
-    read_triplettable();
-
     local ($_) = @_;
     my $arch;
 
+    read_triplettable();
+
     if (/^linux-([^-]*)/) {
 	# XXX: Might disappear in the future, not sure yet.
 	$arch = $1;