first round of Perl::Critic cleanups. Do not use return undef, use a bare return instead
This commit is contained in:
parent
75041656ee
commit
96178fd70c
92 changed files with 209 additions and 209 deletions
|
|
@ -94,7 +94,7 @@ Retrieve content from the filesystem cache.
|
|||
|
||||
sub get {
|
||||
my $self = shift;
|
||||
return undef if ($self->session->config->get("disableCache"));
|
||||
return if ($self->session->config->get("disableCache"));
|
||||
# getting better performance using native dbi than webgui sql
|
||||
my $dbh = $self->session->db->dbh;
|
||||
my $sth = $dbh->prepare("select content from cache where namespace=? and cachekey=? and expires>?");
|
||||
|
|
@ -102,7 +102,7 @@ sub get {
|
|||
my $data = $sth->fetchrow_arrayref;
|
||||
$sth->finish;
|
||||
my $content = $data->[0];
|
||||
return undef unless ($content);
|
||||
return unless ($content);
|
||||
# Storable doesn't like non-reference arguments, so we wrap it in a scalar ref.
|
||||
return ${thaw($content)};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,12 +105,12 @@ Retrieve content from the filesystem cache.
|
|||
|
||||
sub get {
|
||||
my $self = shift;
|
||||
return undef if ($self->session->config->get("disableCache"));
|
||||
return if ($self->session->config->get("disableCache"));
|
||||
my $folder = $self->getFolder;
|
||||
if (-e $folder."/expires" && -e $folder."/cache" && open(my $FILE,"<",$folder."/expires")) {
|
||||
my $expires = <$FILE>;
|
||||
close($FILE);
|
||||
return undef if ($expires < $self->session->datetime->time());
|
||||
return if ($expires < $self->session->datetime->time());
|
||||
my $value;
|
||||
eval {$value = retrieve($folder."/cache")};
|
||||
if (ref $value eq "SCALAR") {
|
||||
|
|
@ -119,7 +119,7 @@ sub get {
|
|||
return $value;
|
||||
}
|
||||
}
|
||||
return undef;
|
||||
return;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue