Merge pull request #20703 from Snuffleupagus/#collectFieldObjects-getOrInsert

Use `Map.prototype.getOrInsert()` in the `#collectFieldObjects` method
This commit is contained in:
Tim van der Meij 2026-02-22 12:39:54 +01:00 committed by GitHub
commit 8189ca358c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1892,10 +1892,7 @@ class PDFDocument {
orphanFields.put(fieldRef, parentRef);
}
if (!promises.has(name)) {
promises.set(name, []);
}
promises.get(name).push(
promises.getOrInsert(name, []).push(
AnnotationFactory.create(
xref,
fieldRef,