mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Simplify helper function.
This commit is contained in:
parent
f4da5d724f
commit
f06dddcf1e
@ -34,8 +34,8 @@ module ts {
|
||||
|
||||
export function getLineStartPositionForPosition(position: number, sourceFile: SourceFile): number {
|
||||
var lineStarts = sourceFile.getLineStarts();
|
||||
var line = sourceFile.getOneBasedLineAndCharacterOfPosition(position).line;
|
||||
return lineStarts[line - 1];
|
||||
var line = sourceFile.getZeroBasedLineAndCharacterOfPosition(position).line;
|
||||
return lineStarts[line];
|
||||
}
|
||||
|
||||
export function rangeContainsRange(r1: TextRange, r2: TextRange): boolean {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user