@@ -72,9 +72,9 @@ private void UpdateState()
72
72
if ( _position >= _cachedLineInfo . Span . End )
73
73
{
74
74
// Try to avoid the GetLocation call by checking if the next line contains the position
75
- int nextLineIndex = _cachedLineInfo . LineIndex + 1 ;
76
- int nextLineLength = _sourceDocument . Lines . GetLineLength ( nextLineIndex ) ;
77
- TextSpan nextLineSpan = new TextSpan ( _cachedLineInfo . Span . End , nextLineLength ) ;
75
+ var nextLineIndex = _cachedLineInfo . LineIndex + 1 ;
76
+ var nextLineLength = _sourceDocument . Lines . GetLineLength ( nextLineIndex ) ;
77
+ var nextLineSpan = new TextSpan ( _cachedLineInfo . Span . End , nextLineLength ) ;
78
78
79
79
if ( nextLineSpan . Contains ( _position ) )
80
80
{
@@ -88,9 +88,9 @@ private void UpdateState()
88
88
else
89
89
{
90
90
// Try to avoid the GetLocation call by checking if the previous line contains the position
91
- int prevLineIndex = _cachedLineInfo . LineIndex - 1 ;
92
- int prevLineLength = _sourceDocument . Lines . GetLineLength ( prevLineIndex ) ;
93
- TextSpan prevLineSpan = new TextSpan ( _cachedLineInfo . Span . Start - prevLineLength , prevLineLength ) ;
91
+ var prevLineIndex = _cachedLineInfo . LineIndex - 1 ;
92
+ var prevLineLength = _sourceDocument . Lines . GetLineLength ( prevLineIndex ) ;
93
+ var prevLineSpan = new TextSpan ( _cachedLineInfo . Span . Start - prevLineLength , prevLineLength ) ;
94
94
95
95
if ( prevLineSpan . Contains ( _position ) )
96
96
{
@@ -105,8 +105,8 @@ private void UpdateState()
105
105
// The call to GetLocation is expensive
106
106
_location = _sourceDocument . Lines . GetLocation ( _position ) ;
107
107
108
- int lineLength = _sourceDocument . Lines . GetLineLength ( _location . LineIndex ) ;
109
- TextSpan lineSpan = new TextSpan ( _position - _location . CharacterIndex , lineLength ) ;
108
+ var lineLength = _sourceDocument . Lines . GetLineLength ( _location . LineIndex ) ;
109
+ var lineSpan = new TextSpan ( _position - _location . CharacterIndex , lineLength ) ;
110
110
_cachedLineInfo = ( lineSpan , _location . LineIndex ) ;
111
111
112
112
_current = _sourceDocument [ _location . AbsoluteIndex ] ;
0 commit comments