We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1118050 + 76a5aed commit 2631750Copy full SHA for 2631750
1 file changed
src/core/core_utils.js
@@ -669,12 +669,7 @@ function getNewAnnotationsMap(annotationStorage) {
669
if (!key.startsWith(AnnotationEditorPrefix)) {
670
continue;
671
}
672
- let annotations = newAnnotationsByPage.get(value.pageIndex);
673
- if (!annotations) {
674
- annotations = [];
675
- newAnnotationsByPage.set(value.pageIndex, annotations);
676
- }
677
- annotations.push(value);
+ newAnnotationsByPage.getOrInsert(value.pageIndex, []).push(value);
678
679
return newAnnotationsByPage.size > 0 ? newAnnotationsByPage : null;
680
0 commit comments