diff options
author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-03-02 19:16:23 +0100 |
---|---|---|
committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-03-02 19:16:23 +0100 |
commit | 72dbda078045a406732afe9c7fe15e105b50540c (patch) | |
tree | 37b46e84dab1887b438edcfea219e687b0616e81 /SBO-Lib/lib/SBO/Lib.pm | |
parent | 828ae34132ae347746bd9fc46ced5e7d71d6a7e0 (diff) | |
download | sbotools2-72dbda078045a406732afe9c7fe15e105b50540c.tar.xz |
No need for a temporary variable to deref an array if it's a ref
Diffstat (limited to 'SBO-Lib/lib/SBO/Lib.pm')
-rw-r--r-- | SBO-Lib/lib/SBO/Lib.pm | 7 |
1 files 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); |