@@ -329,13 +329,11 @@ namespace ts.server {
329
329
const seen = createDocumentSpanSet ( ) ;
330
330
331
331
perProjectResults . forEach ( ( projectResults , project ) => {
332
- if ( projectResults ) {
333
- for ( const result of projectResults ) {
334
- // If there's a mapped location, it'll appear in the results for another project
335
- if ( ! seen . has ( result ) && ! getMappedLocationForProject ( documentSpanLocation ( result ) , project ) ) {
336
- results . push ( result ) ;
337
- seen . add ( result ) ;
338
- }
332
+ for ( const result of projectResults ) {
333
+ // If there's a mapped location, it'll appear in the results for another project
334
+ if ( ! seen . has ( result ) && ! getMappedLocationForProject ( documentSpanLocation ( result ) , project ) ) {
335
+ results . push ( result ) ;
336
+ seen . add ( result ) ;
339
337
}
340
338
}
341
339
} ) ;
@@ -385,11 +383,9 @@ namespace ts.server {
385
383
if ( defaultProjectResults ?. [ 0 ] ?. references [ 0 ] ?. isDefinition === undefined ) {
386
384
// Clear all isDefinition properties
387
385
perProjectResults . forEach ( projectResults => {
388
- if ( projectResults ) {
389
- for ( const referencedSymbol of projectResults ) {
390
- for ( const ref of referencedSymbol . references ) {
391
- delete ref . isDefinition ;
392
- }
386
+ for ( const referencedSymbol of projectResults ) {
387
+ for ( const ref of referencedSymbol . references ) {
388
+ delete ref . isDefinition ;
393
389
}
394
390
}
395
391
} ) ;
@@ -588,7 +584,8 @@ namespace ts.server {
588
584
// it easier for the caller to skip post-processing.
589
585
if ( resultsMap . size === 1 ) {
590
586
const it = resultsMap . values ( ) . next ( ) ;
591
- return it . done ? emptyArray : it . value ; // There may not be any results at all
587
+ Debug . assert ( ! it . done ) ;
588
+ return it . value ;
592
589
}
593
590
594
591
return resultsMap ;
0 commit comments