summaryrefslogtreecommitdiffstats
path: root/lib/Smokeping/matchers/Median.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Smokeping/matchers/Median.pm')
-rw-r--r--lib/Smokeping/matchers/Median.pm3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Smokeping/matchers/Median.pm b/lib/Smokeping/matchers/Median.pm
index 3c8560a..65d71e2 100644
--- a/lib/Smokeping/matchers/Median.pm
+++ b/lib/Smokeping/matchers/Median.pm
@@ -73,8 +73,7 @@ sub Test($$)
my $ac = $self->{param}{old};
my $bc = $self->{param}{new};
my $cc = $ac +$bc;
- my $oldm = (sort {$a <=> $b} @{$data->{rtt}}[-$cc..-$bc-1])[int($a/2)];
- $ac++;
+ my $oldm = (sort {$a <=> $b} @{$data->{rtt}}[-$cc..-$bc-1])[int($ac/2)];
my $newm = (sort {$a <=> $b} @{$data->{rtt}}[-$bc..-1])[int($bc/2)];
return abs($oldm-$newm) > $self->{param}{diff};
}