Use Map.prototype.getOrInsert() in the #collectFieldObjects method

This commit is contained in:
Jonas Jenwald 2026-02-21 11:23:32 +01:00
parent f548a159d6
commit 210c969c4c

View File

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