Index: Source/devtools/front_end/MemoryStatistics.js |
diff --git a/Source/devtools/front_end/MemoryStatistics.js b/Source/devtools/front_end/MemoryStatistics.js |
index 743fa1f41ce3837468215ee9f716c38b7d3ff868..9ca0ac262bbaf31030a615014f0fa886caeeb597 100644 |
--- a/Source/devtools/front_end/MemoryStatistics.js |
+++ b/Source/devtools/front_end/MemoryStatistics.js |
@@ -264,18 +264,12 @@ WebInspector.MemoryStatistics.prototype = { |
{ |
return value - sample.time; |
} |
- var firstIndex = binarySearch(start, this._counters, comparator); |
- var lastIndex = binarySearch(end, this._counters, comparator); |
- if (firstIndex < 0) |
- firstIndex = Math.max(0, -firstIndex - 2); |
- if (lastIndex < 0) |
- lastIndex = Math.min(-lastIndex - 1, this._counters.length - 1); |
// Maximum index of element whose time <= start. |
- this._minimumIndex = firstIndex; |
+ this._minimumIndex = Number.constrain(this._counters.upperBound(start, comparator) - 1, 0, this._counters.length - 1); |
// Minimum index of element whose time >= end. |
- this._maximumIndex = lastIndex; |
+ this._maximumIndex = Number.constrain(this._counters.lowerBound(end, comparator), 0, this._counters.length - 1); |
// Current window bounds. |
this._minTime = start; |