From 030c4f7d5ced92d6a0e83e2f62d312f262cf2f4c Mon Sep 17 00:00:00 2001 From: lloyd Date: Thu, 14 Feb 2008 15:29:52 +0000 Subject: Pass the second argument of works_on as a reference, requires slightly fewer explicit coercions. --- configure.pl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/configure.pl b/configure.pl index 4d7912871..033e99a7f 100755 --- a/configure.pl +++ b/configure.pl @@ -1031,7 +1031,8 @@ sub load_module { my %module = %{$MODULES{$modname}}; my $works_on = sub { - my ($what, @lst) = @_; + my ($what, $lst_ref) = @_; + my @lst = @{$lst_ref}; return 1 if not @lst; # empty list -> no restrictions return 1 if $what eq 'generic'; # trust the user return in_array($what, \@lst); @@ -1041,19 +1042,19 @@ sub load_module { my $os = $$config{'os'}; croak("Module '$modname' does not run on $os") - unless(&$works_on($os, @{$module{'os'}})); + unless(&$works_on($os, $module{'os'})); my $arch = $$config{'arch'}; my $sub = $$config{'submodel'}; croak("Module '$modname' does not run on $arch/$sub") - unless(&$works_on($arch, @{$module{'arch'}}) or - &$works_on($sub, @{$module{'arch'}})); + unless(&$works_on($arch, $module{'arch'}) or + &$works_on($sub, $module{'arch'})); my $cc = $$config{'compiler'}; croak("Module '$modname' does not work with $cc") - unless(&$works_on($cc, @{$module{'cc'}})); + unless(&$works_on($cc, $module{'cc'})); my $handle_files = sub { my($lst, $func) = @_; -- cgit v1.2.3