mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Use more optional chaining in the code-base
This patch updates a bunch of older code, that makes conditional function calls, to use optional chaining rather than `if`-blocks. These mostly mechanical changes reduce the size of the `gulp mozcentral` build by a little over 1 kB.
This commit is contained in:
parent
9578152ae4
commit
38ee28b1d3
15 changed files with 51 additions and 119 deletions
|
@ -1543,9 +1543,7 @@ if (
|
|||
}
|
||||
|
||||
eoFill() {
|
||||
if (this.current.element) {
|
||||
this.current.element.setAttributeNS(null, "fill-rule", "evenodd");
|
||||
}
|
||||
this.current.element?.setAttributeNS(null, "fill-rule", "evenodd");
|
||||
this.fill();
|
||||
}
|
||||
|
||||
|
@ -1557,9 +1555,7 @@ if (
|
|||
}
|
||||
|
||||
eoFillStroke() {
|
||||
if (this.current.element) {
|
||||
this.current.element.setAttributeNS(null, "fill-rule", "evenodd");
|
||||
}
|
||||
this.current.element?.setAttributeNS(null, "fill-rule", "evenodd");
|
||||
this.fillStroke();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue