Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1547)

Unified Diff: Source/devtools/front_end/timeline/TimelineModel.js

Issue 322783002: Initialize min/max record time to 0 instead of -1 or null (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/timeline/TimelineModel.js
diff --git a/Source/devtools/front_end/timeline/TimelineModel.js b/Source/devtools/front_end/timeline/TimelineModel.js
index 35ebfb508f4abf7979b4da5c3ed17af72e566416..2c310fcf07bc511c654cffc5caeec2c86ad28c80 100644
--- a/Source/devtools/front_end/timeline/TimelineModel.js
+++ b/Source/devtools/front_end/timeline/TimelineModel.js
@@ -251,8 +251,8 @@ WebInspector.TimelineModel.prototype = {
{
this._loadedFromFile = false;
this._records = [];
- this._minimumRecordTime = -1;
- this._maximumRecordTime = -1;
+ this._minimumRecordTime = 0;
+ this._maximumRecordTime = 0;
/** @type {!Array.<!WebInspector.TimelineModel.Record>} */
this._mainThreadTasks = [];
/** @type {!Array.<!WebInspector.TimelineModel.Record>} */
@@ -286,9 +286,9 @@ WebInspector.TimelineModel.prototype = {
var startTime = record.startTime();
var endTime = record.endTime();
- if (this._minimumRecordTime === -1 || startTime < this._minimumRecordTime)
+ if (!this._minimumRecordTime || startTime < this._minimumRecordTime)
this._minimumRecordTime = startTime;
- if ((this._maximumRecordTime === -1 && endTime) || endTime > this._maximumRecordTime)
+ if (endTime > this._maximumRecordTime)
this._maximumRecordTime = endTime;
},
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineFlameChart.js ('k') | Source/devtools/front_end/timeline/TimelineOverviewPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698