mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-29 10:27:21 +02:00
Use Map.prototype.getOrInsert() in the src/display/annotation_layer.js file
This commit is contained in:
parent
5bb35eeb35
commit
ab8e67ecff
@ -3877,12 +3877,7 @@ class AnnotationLayer {
|
|||||||
this.#elements.push(element);
|
this.#elements.push(element);
|
||||||
|
|
||||||
if (data.popupRef) {
|
if (data.popupRef) {
|
||||||
const elements = popupToElements.get(data.popupRef);
|
popupToElements.getOrInsert(data.popupRef, []).push(element);
|
||||||
if (!elements) {
|
|
||||||
popupToElements.set(data.popupRef, [element]);
|
|
||||||
} else {
|
|
||||||
elements.push(element);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user