Skip to content
Snippets Groups Projects
Commit da658f47 authored by Dan Staines's avatar Dan Staines
Browse files

minor improvement to how code handles arrays

parent a0b3a95e
No related branches found
No related tags found
No related merge requests found
......@@ -9,8 +9,7 @@ use warnings;
sub get_option {
my ($self) = @_;
my @biotypes = $self->get_biotype_group("coding");
return \@biotypes;
return $self->get_biotype_group("coding");
}
1;
......
......@@ -190,8 +190,7 @@ sub get_analysis {
sub get_biotype_group {
my ($self, $group) = @_;
my $prod_dba = $self->get_production_DBAdaptor();
my $helper = $prod_dba->dbc()->sql_helper();
my $helper = $self->get_production_DBAdaptor()->dbc()->sql_helper();
my $sql = q{
SELECT name
FROM biotype
......@@ -199,8 +198,7 @@ sub get_biotype_group {
AND is_current = 1
AND biotype_group = ?
AND db_type like '%core%' };
my @biotypes = @{$helper->execute_simple(-SQL => $sql, -PARAMS => [$group])};
return @biotypes;
return $helper->execute_simple(-SQL => $sql, -PARAMS => [$group]) || [];
}
# Empty method if no specific option is needed
......
......@@ -9,8 +9,7 @@ use warnings;
sub get_option {
my ($self) = @_;
my @biotypes = $self->get_biotype_group("noncoding");
return \@biotypes;
return $self->get_biotype_group("noncoding");
}
1;
......
......@@ -9,8 +9,7 @@ use warnings;
sub get_option {
my ($self) = @_;
my @biotypes = $self->get_biotype_group("pseudogene");
return \@biotypes;
return $self->get_biotype_group("pseudogene");
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment