mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-04-09 23:04:02 +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);
|
||||
|
||||
if (data.popupRef) {
|
||||
const elements = popupToElements.get(data.popupRef);
|
||||
if (!elements) {
|
||||
popupToElements.set(data.popupRef, [element]);
|
||||
} else {
|
||||
elements.push(element);
|
||||
}
|
||||
popupToElements.getOrInsert(data.popupRef, []).push(element);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user