@@ -228,26 +228,28 @@ export function readWorkspaceFiles(): FileData[] {
228
228
'read workspace files:start' ,
229
229
'read workspace files:end'
230
230
) ;
231
+ r . sort ( ( x , y ) => x . file . localeCompare ( y . file ) ) ;
231
232
return r ;
232
233
} else {
233
- const files = [ ] ;
234
- files . push ( ...rootWorkspaceFileData ( ) ) ;
234
+ const r = [ ] ;
235
+ r . push ( ...rootWorkspaceFileData ( ) ) ;
235
236
236
237
// Add known workspace files and directories
237
- files . push ( ...allFilesInDir ( appRootPath , false ) ) ;
238
- files . push ( ...allFilesInDir ( `${ appRootPath } /tools` ) ) ;
238
+ r . push ( ...allFilesInDir ( appRootPath , false ) ) ;
239
+ r . push ( ...allFilesInDir ( `${ appRootPath } /tools` ) ) ;
239
240
const wl = workspaceLayout ( ) ;
240
- files . push ( ...allFilesInDir ( `${ appRootPath } /${ wl . appsDir } ` ) ) ;
241
+ r . push ( ...allFilesInDir ( `${ appRootPath } /${ wl . appsDir } ` ) ) ;
241
242
if ( wl . appsDir !== wl . libsDir ) {
242
- files . push ( ...allFilesInDir ( `${ appRootPath } /${ wl . libsDir } ` ) ) ;
243
+ r . push ( ...allFilesInDir ( `${ appRootPath } /${ wl . libsDir } ` ) ) ;
243
244
}
244
245
performance . mark ( 'read workspace files:end' ) ;
245
246
performance . measure (
246
247
'read workspace files' ,
247
248
'read workspace files:start' ,
248
249
'read workspace files:end'
249
250
) ;
250
- return files ;
251
+ r . sort ( ( x , y ) => x . file . localeCompare ( y . file ) ) ;
252
+ return r ;
251
253
}
252
254
}
253
255
@@ -277,12 +279,10 @@ export function normalizedProjectRoot(p: ProjectGraphNode): string {
277
279
278
280
export function filesChanged ( a : FileData [ ] , b : FileData [ ] ) {
279
281
if ( a . length !== b . length ) return true ;
280
- const sortedA = a . sort ( ( x , y ) => x . file . localeCompare ( y . file ) ) ;
281
- const sortedB = b . sort ( ( x , y ) => x . file . localeCompare ( y . file ) ) ;
282
282
283
- for ( let i = 0 ; i < sortedA . length ; ++ i ) {
284
- if ( sortedA [ i ] . file !== sortedB [ i ] . file ) return true ;
285
- if ( sortedA [ i ] . hash !== sortedB [ i ] . hash ) return true ;
283
+ for ( let i = 0 ; i < a . length ; ++ i ) {
284
+ if ( a [ i ] . file !== b [ i ] . file ) return true ;
285
+ if ( a [ i ] . hash !== b [ i ] . hash ) return true ;
286
286
}
287
287
return false ;
288
288
}
0 commit comments