From 72dbda078045a406732afe9c7fe15e105b50540c Mon Sep 17 00:00:00 2001 From: Andreas Guldstrand Date: Wed, 2 Mar 2016 19:16:23 +0100 Subject: No need for a temporary variable to deref an array if it's a ref --- SBO-Lib/lib/SBO/Lib.pm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index 6d23e82..f42fa2e 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -433,11 +433,8 @@ sub get_inst_names { sub get_sbo_location { @_ >= 1 or script_error('get_sbo_location requires an argument.'); - my @sbos = @_; - if (ref $sbos[0] eq 'ARRAY') { - my $tmp = $sbos[0]; - @sbos = @$tmp; - } + my @sbos = ref $_[0] eq 'ARRAY' ? @{ $_[0] } : @_; + # if we already have the location, return it now. return $$store{$sbos[0]} if exists $$store{$sbos[0]}; my %locations = get_sbo_locations(@sbos); -- cgit v1.2.3