mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-24 20:44:53 -05:00
Remove unnecessary length check in getSyntacticDocumentHighlights (#22064)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user