]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Ignore extra samples in reported nruns
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 18 Apr 2011 10:36:02 +0000 (12:36 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 18 Apr 2011 10:36:02 +0000 (12:36 +0200)
regress.c

index af69e113ee32e3a0e26d4df4a623f7b5119909c6..e78fafe472e522c629a5cc78439dcc58a8461f5e 100644 (file)
--- a/regress.c
+++ b/regress.c
@@ -299,6 +299,10 @@ RGR_FindBestRegression
     nruns = n_runs_from_residuals(resid, n - resid_start); 
 
     if (nruns > critical_runs[n - resid_start] || n - start <= MIN_SAMPLES_FOR_REGRESS) {
+      if (resid_start < 0) {
+        /* Ignore extra samples in returned nruns */
+        nruns = n_runs_from_residuals(resid - resid_start, n); 
+      }
       break;
     } else {
       /* Try dropping one sample at a time until the runs test passes. */