Bug 1424760 (Part 1) - Fix an off-by-one error r=gfritzsche
authorPaul Bone <pbone@mozilla.com>
Sat, 16 Dec 2017 02:35:25 +1100
changeset 399392 aee5e05a7e0cee7c42e0f3d2a33d9499dcc7a837
parent 399391 5be045f0db762ad5214437fadc7b177df88708be
child 399393 e65bb33f2ae069c91f7e379d1b19e814934f5fb7
push id33262
push userapavel@mozilla.com
push dateTue, 16 Jan 2018 09:50:38 +0000
treeherdermozilla-central@e4107773cffb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche
bugs1424760
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1424760 (Part 1) - Fix an off-by-one error r=gfritzsche limitProperties would reject payloads with the maximum number of properties, when it should accept these and only reject when they exceed the maximum.
toolkit/components/telemetry/GCTelemetry.jsm
--- a/toolkit/components/telemetry/GCTelemetry.jsm
+++ b/toolkit/components/telemetry/GCTelemetry.jsm
@@ -113,17 +113,17 @@ class GCData {
 const MAX_GC_KEYS = 24;
 const MAX_SLICES = 4;
 const MAX_SLICE_KEYS = 12;
 const MAX_PHASES = 65;
 
 function limitProperties(obj, count) {
   // If there are too many properties, just delete them all. We don't
   // expect this ever to happen.
-  if (Object.keys(obj).length > count) {
+  if (Object.keys(obj).length >= count) {
     for (let key of Object.keys(obj)) {
       delete obj[key];
     }
   }
 }
 
 function limitSize(data) {
   // Store the number of slices so we know if we lost any at the end.