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.
This commit is contained in:
parent
9fc40f8b84
commit
8e5d3836d6
@ -380,16 +380,12 @@ function getFilenameFromUrl(url) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class StatTimer {
|
class StatTimer {
|
||||||
constructor(enable = true) {
|
constructor() {
|
||||||
this.enabled = !!enable;
|
|
||||||
this.started = Object.create(null);
|
this.started = Object.create(null);
|
||||||
this.times = [];
|
this.times = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
time(name) {
|
time(name) {
|
||||||
if (!this.enabled) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (name in this.started) {
|
if (name in this.started) {
|
||||||
warn('Timer is already running for ' + name);
|
warn('Timer is already running for ' + name);
|
||||||
}
|
}
|
||||||
@ -397,9 +393,6 @@ class StatTimer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
timeEnd(name) {
|
timeEnd(name) {
|
||||||
if (!this.enabled) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!(name in this.started)) {
|
if (!(name in this.started)) {
|
||||||
warn('Timer has not been started for ' + name);
|
warn('Timer has not been started for ' + name);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user