Commit b7ddb571 authored by Peter Pentchev's avatar Peter Pentchev

Use autovivification instead of an unwieldy //.

parent accff1e9
......@@ -6,6 +6,7 @@ Change log for ethstats, the network traffic statistics utility
- add a trivial translation of ethstats to Perl 6
- do not make all the warnings fatal, this is bad for
forwards-compatibility
- use autovivification instead of an unwiedly defined-or
1.1.0 2015/12/11
- use Getopt::Std for command-line option processing
......
......@@ -105,9 +105,7 @@ sub add_up_totals($ $)
for my $what (keys %{$total}) {
for my $dir (qw(in out)) {
$total->{$what}{$dir} =
($total->{$what}{$dir} // 0) +
$dev->{$what}{$dir};
$total->{$what}{$dir} += $dev->{$what}{$dir};
}
}
}
......
Markdown is supported
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