Skip to content

Commit a7c5fad

Browse files
committed
сокращено получение CurrentColumn
1 parent 8ea8b74 commit a7c5fad

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/OneScript.Language/LexicalAnalysis/SourceCodeIterator.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,8 @@ private void InitOnString(string code)
7070
public int CurrentLine => _lineCounter;
7171

7272
public int CurrentColumn
73-
{
74-
get
75-
{
76-
if (_startPosition == OUT_OF_TEXT)
77-
{
78-
return OUT_OF_TEXT;
79-
}
80-
81-
int start = GetLineBound(_lineCounter);
82-
return _index - start + 1;
83-
}
84-
}
73+
=> _startPosition == OUT_OF_TEXT ? OUT_OF_TEXT : _index - _lineBounds[^1] + 1;
74+
// CurrentLine's start is last in _lineBounds
8575

8676
public char CurrentSymbol => _currentSymbol;
8777

0 commit comments

Comments
 (0)