Skip to content

Commit ba8bc55

Browse files
author
Benjamin Lichtman
committed
Make regexp a constant
1 parent f0e5056 commit ba8bc55

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/services/outliningElementsCollector.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ namespace ts.OutliningElementsCollector {
8383
}
8484
}
8585

86+
const regionDelimiterRegExp = /^\s*\/\/\s*#(end)?region(?:\s+(.*))?(?:\r)?$/;
8687
function isRegionDelimiter(lineText: string) {
87-
return lineText.match(/^\s*\/\/\s*#(end)?region(?:\s+(.*))?(?:\r)?$/);
88+
return regionDelimiterRegExp.exec(lineText);
8889
}
8990

9091
function addOutliningForLeadingCommentsForNode(n: Node, sourceFile: SourceFile, cancellationToken: CancellationToken, out: Push<OutliningSpan>): void {

0 commit comments

Comments
 (0)