Skip to content

Commit 210c969

Browse files
committed
Use Map.prototype.getOrInsert() in the #collectFieldObjects method
1 parent f548a15 commit 210c969

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/core/document.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,10 +1892,7 @@ class PDFDocument {
18921892
orphanFields.put(fieldRef, parentRef);
18931893
}
18941894

1895-
if (!promises.has(name)) {
1896-
promises.set(name, []);
1897-
}
1898-
promises.get(name).push(
1895+
promises.getOrInsert(name, []).push(
18991896
AnnotationFactory.create(
19001897
xref,
19011898
fieldRef,

0 commit comments

Comments
 (0)