mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-12 21:21:04 +02:00
Shorten the DrawLayerBuilder.prototype.cancel method a tiny bit
By replacing the early return with optional chaining, a pattern that we already use in lots of places, the code becomes a tiny bit shorter and more importantly the code coverage for this file becomes 100 percent.
This commit is contained in:
parent
f12c463452
commit
0eca809589
@ -68,10 +68,7 @@ class DrawLayerBuilder {
|
||||
cancel() {
|
||||
this._cancelled = true;
|
||||
|
||||
if (!this.#drawLayer) {
|
||||
return;
|
||||
}
|
||||
this.#drawLayer.destroy();
|
||||
this.#drawLayer?.destroy();
|
||||
this.#drawLayer = null;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user