Skip to content

Commit ab8e67e

Browse files
committed
Use Map.prototype.getOrInsert() in the src/display/annotation_layer.js file
1 parent 5bb35ee commit ab8e67e

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/display/annotation_layer.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3877,12 +3877,7 @@ class AnnotationLayer {
38773877
this.#elements.push(element);
38783878

38793879
if (data.popupRef) {
3880-
const elements = popupToElements.get(data.popupRef);
3881-
if (!elements) {
3882-
popupToElements.set(data.popupRef, [element]);
3883-
} else {
3884-
elements.push(element);
3885-
}
3880+
popupToElements.getOrInsert(data.popupRef, []).push(element);
38863881
}
38873882
}
38883883

0 commit comments

Comments
 (0)