File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -989,11 +989,10 @@ class CanvasGraphics {
989989 : [ currentTransform . slice ( 0 , 4 ) , fillColor ]
990990 ) ;
991991
992- cache = this . _cachedBitmapsMap . get ( mainKey ) ;
993- if ( ! cache ) {
994- cache = new Map ( ) ;
995- this . _cachedBitmapsMap . set ( mainKey , cache ) ;
996- }
992+ cache = this . _cachedBitmapsMap . getOrInsertComputed (
993+ mainKey ,
994+ ( ) => new Map ( )
995+ ) ;
997996 const cachedImage = cache . get ( cacheKey ) ;
998997 if ( cachedImage && ! isPatternFill ) {
999998 const offsetX = Math . round (
You can’t perform that action at this time.
0 commit comments