Commit 1f7581b
committed
Shorten the
The effect is probably not even measurable, however this patch ever so slightly reduces the asynchronicity in the `fieldObjects` getter. These changes should be safe since:
- We're inside of the `PDFDocument`-class and the `annotationGlobals`-getter, which will always return a (shadowed) Promise and won't throw `MissingDataException`s, can be accessed directly without going through the `BasePdfManager`-instance.
- The `acroForm`-dictionary can be accessed through the `annotationGlobals`-data, removing the need to "manually" look it up and thus the need for using `Promise.all` here.
- We can also lookup the /Fields-data, in the `acroForm`-dictionary, synchronously since the initial `formInfo.hasFields` check guarantees that it's available.PDFDocument.prototype.fieldObjects getter slightly1 parent 6f05231 commit 1f7581b
1 file changed
+3
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1871 | 1871 | | |
1872 | 1872 | | |
1873 | 1873 | | |
1874 | | - | |
1875 | | - | |
1876 | | - | |
1877 | | - | |
1878 | | - | |
| 1874 | + | |
1879 | 1875 | | |
1880 | 1876 | | |
1881 | 1877 | | |
| 1878 | + | |
1882 | 1879 | | |
1883 | 1880 | | |
1884 | 1881 | | |
1885 | 1882 | | |
1886 | 1883 | | |
1887 | | - | |
| 1884 | + | |
1888 | 1885 | | |
1889 | 1886 | | |
1890 | 1887 | | |
| |||
0 commit comments