mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-13 06:20:23 -06:00
Remove unnecessary length check in getSyntacticDocumentHighlights (#22064)
This commit is contained in:
parent
c7f65e8725
commit
7b929e090d
@ -30,11 +30,7 @@ namespace ts.DocumentHighlights {
|
||||
|
||||
function getSyntacticDocumentHighlights(node: Node, sourceFile: SourceFile): DocumentHighlights[] {
|
||||
const highlightSpans = getHighlightSpans(node, sourceFile);
|
||||
if (!highlightSpans || highlightSpans.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return [{ fileName: sourceFile.fileName, highlightSpans }];
|
||||
return highlightSpans && [{ fileName: sourceFile.fileName, highlightSpans }];
|
||||
}
|
||||
|
||||
function getHighlightSpans(node: Node, sourceFile: SourceFile): HighlightSpan[] | undefined {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user