From 8e5d3836d6e16fe53361729d868f140dbbf56c49 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 23 Oct 2019 13:33:01 +0200 Subject: [PATCH] Remove the `enable` argument from the `StatTimer` constructor This argument is a left-over from older API code, where we unconditionally initialized `StatTimer` instances for every page. For quite some time that's only been done when `pdfBug` is set, hence it seems unnecessary to keep this functionality. --- src/display/display_utils.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/display/display_utils.js b/src/display/display_utils.js index e59246342..d6f3ec385 100644 --- a/src/display/display_utils.js +++ b/src/display/display_utils.js @@ -380,16 +380,12 @@ function getFilenameFromUrl(url) { } class StatTimer { - constructor(enable = true) { - this.enabled = !!enable; + constructor() { this.started = Object.create(null); this.times = []; } time(name) { - if (!this.enabled) { - return; - } if (name in this.started) { warn('Timer is already running for ' + name); } @@ -397,9 +393,6 @@ class StatTimer { } timeEnd(name) { - if (!this.enabled) { - return; - } if (!(name in this.started)) { warn('Timer has not been started for ' + name); }