commit 72dbda078045a406732afe9c7fe15e105b50540c
parent 828ae34132ae347746bd9fc46ced5e7d71d6a7e0
Author: Andreas Guldstrand <andreas.guldstrand@gmail.com>
Date: Wed, 2 Mar 2016 19:16:23 +0100
No need for a temporary variable to deref an array if it's a ref
Diffstat:
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git 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);