@@ -645,7 +645,7 @@ class DisplayLayer {
645645    let  lastScreenRow  =  startRow 
646646    let  lastBufferRow  =  this . translateScreenPositionWithSpatialIndex ( startPosition ) . row 
647647    const  hunks  =  this . spatialIndex . getChangesInNewRange ( startPosition ,  Point ( endRow ,  0 ) ) 
648-     for  ( let  i  =  0 ;   i   <  hunks . length ;  i ++ )  { 
648+     for  ( let  i  =  0 ,   len   =  hunks . length ;   i   <   len ;  i ++ )  { 
649649      const  hunk  =  hunks [ i ] 
650650      while  ( lastScreenRow  <=  hunk . newStart . row )  { 
651651        bufferRows . push ( lastBufferRow ) 
@@ -689,7 +689,7 @@ class DisplayLayer {
689689
690690  leadingWhitespaceLengthForNonEmptyLine  ( line )  { 
691691    let  length  =  0 
692-     for  ( let  i  =  0 ;   i   <  line . length ;  i ++ )  { 
692+     for  ( let  i  =  0 ,   len   =  line . length ;   i   <   len ;  i ++ )  { 
693693      const  character  =  line [ i ] 
694694      if  ( character  ===  ' ' )  { 
695695        length ++ 
@@ -935,7 +935,7 @@ class DisplayLayer {
935935          let  unexpandedScreenColumnAfterLastTab  =  indentLength 
936936          let  expandedScreenColumnAfterLastTab  =  indentLength 
937937          let  tabCountPrecedingWrap  =  0 
938-           for  ( let  i  =  0 ;   i   <  currentScreenLineTabColumns . length ;  i ++ )  { 
938+           for  ( let  i  =  0 ,   len   =  currentScreenLineTabColumns . length ;   i   <   len ;  i ++ )  { 
939939            const  tabColumn  =  currentScreenLineTabColumns [ i ] 
940940            if  ( tabColumn  <  unexpandedWrapColumn )  { 
941941              tabCountPrecedingWrap ++ 
@@ -1140,12 +1140,13 @@ class DisplayLayer {
11401140      } 
11411141    } 
11421142
1143-     for  ( let  i  =  0 ;  i  <  foldMarkers . length ;  i ++ )  { 
1143+     const  foldMarkersLength  =  foldMarkers . length 
1144+     for  ( let  i  =  0 ;  i  <  foldMarkersLength ;  i ++ )  { 
11441145      const  foldStart  =  foldMarkers [ i ] . getStartPosition ( ) 
11451146      let  foldEnd  =  foldMarkers [ i ] . getEndPosition ( ) 
11461147
11471148      // Merge overlapping folds 
1148-       while  ( i  <  foldMarkers . length  -  1 )  { 
1149+       while  ( i  <  foldMarkersLength  -  1 )  { 
11491150        const  nextFoldMarker  =  foldMarkers [ i  +  1 ] 
11501151        if  ( compare ( nextFoldMarker . getStartPosition ( ) ,  foldEnd )  <  0 )  { 
11511152          if  ( compare ( foldEnd ,  nextFoldMarker . getEndPosition ( ) )  <  0 )  { 
0 commit comments