File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
apps/oxlint/src-js/plugins Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,8 @@ export const SOURCE_CODE = Object.freeze({
226226
227227 const commentsAfter : Comment [ ] = [ ] ;
228228
229- for ( let i = 0 ; i < comments . length ; i ++ ) {
229+ const commentsLength = comments . length ;
230+ for ( let i = 0 ; i < commentsLength ; i ++ ) {
230231 const comment = comments [ i ] ;
231232 const commentStart = comment . start ;
232233
@@ -294,9 +295,10 @@ export const SOURCE_CODE = Object.freeze({
294295 commentsExistBetween ( nodeOrToken1 : NodeOrToken , nodeOrToken2 : NodeOrToken ) : boolean {
295296 // Find the first comment after `nodeOrToken1` ends.
296297 // Check if it ends before `nodeOrToken2` starts.
297- const { comments } = ast ;
298+ const { comments } = ast ,
299+ commentsLength = comments . length ;
298300 const betweenRangeStart = nodeOrToken1 . range [ 1 ] ; // end
299- for ( let i = 0 ; i < comments . length ; i ++ ) {
301+ for ( let i = 0 ; i < commentsLength ; i ++ ) {
300302 const comment = comments [ i ] ;
301303 if ( comment . start >= betweenRangeStart ) {
302304 return comment . end <= nodeOrToken2 . range [ 0 ] ; // start
You can’t perform that action at this time.
0 commit comments