mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 11:24:29 -05:00
Merge pull request #8829 from Microsoft/tslintPerf
add a extra check to avoid rescans in Node.getStart
This commit is contained in:
@@ -267,6 +267,9 @@ namespace ts {
|
||||
// find the child that contains 'position'
|
||||
for (let i = 0, n = current.getChildCount(sourceFile); i < n; i++) {
|
||||
const child = current.getChildAt(i);
|
||||
if (position < child.getFullStart() || position > child.getEnd()) {
|
||||
continue;
|
||||
}
|
||||
const start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile);
|
||||
if (start <= position) {
|
||||
const end = child.getEnd();
|
||||
|
||||
Reference in New Issue
Block a user