Skip to content

Commit 7b929e0

Browse files
author
Andy
authored
Remove unnecessary length check in getSyntacticDocumentHighlights (microsoft#22064)
1 parent c7f65e8 commit 7b929e0

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/services/documentHighlights.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ namespace ts.DocumentHighlights {
3030

3131
function getSyntacticDocumentHighlights(node: Node, sourceFile: SourceFile): DocumentHighlights[] {
3232
const highlightSpans = getHighlightSpans(node, sourceFile);
33-
if (!highlightSpans || highlightSpans.length === 0) {
34-
return undefined;
35-
}
36-
37-
return [{ fileName: sourceFile.fileName, highlightSpans }];
33+
return highlightSpans && [{ fileName: sourceFile.fileName, highlightSpans }];
3834
}
3935

4036
function getHighlightSpans(node: Node, sourceFile: SourceFile): HighlightSpan[] | undefined {

0 commit comments

Comments
 (0)