Skip to content

Commit

Permalink
Fix warnings in DAOLogger (#2738)
Browse files Browse the repository at this point in the history
We had a bunch of uninitialized values here,
and they were triggering warnings I did not see earlier
because I don't usually run CATALYST_DEBUG.
  • Loading branch information
reosarevok authored Nov 17, 2022
1 parent c81616d commit 5df6a87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Plack/Middleware/Debug/DAOLogger.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sub run {
$i = 0;

return sub {
my $sum = sum(map { $_->[1] } @call_stack);
my $sum = sum(map { $_->[1] } @call_stack) // 0;

$panel->content(
'<p>This panel shows time spent within the data access layer. Rows '.
Expand All @@ -39,7 +39,7 @@ sub run {

sub render_stack {
my ($indent, @stack) = @_;
return unless @stack;
return '' unless @stack;

my @times = map { $_->[1] } @stack;
my $mean = mean(@times);
Expand Down

0 comments on commit 5df6a87

Please sign in to comment.