Skip to content

Commit 4816433

Browse files
committed
Oops, I tried to get too cute 🤦‍♂️
1 parent 7de7ca7 commit 4816433

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/TextDifferencing/SourceTextDiffer.TextSpanDiffer.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ public TextSpanDiffer(SourceText oldText, SourceText newText)
2828
_newLineBuffer = RentArray(1024);
2929
_appendBuffer = RentArray(1024);
3030

31-
OldSourceLength = _oldLines.Length;
32-
NewSourceLength = _newLines.Length;
33-
34-
if (OldSourceLength > 0)
31+
if (oldText.Length > 0)
3532
{
3633
_oldLines = Tokenize(oldText);
3734
}
3835

39-
if (NewSourceLength > 0)
36+
if (newText.Length > 0)
4037
{
4138
_newLines = Tokenize(newText);
4239
}
40+
41+
OldSourceLength = _oldLines.Length;
42+
NewSourceLength = _newLines.Length;
4343
}
4444

4545
protected abstract ImmutableArray<TextSpan> Tokenize(SourceText text);

0 commit comments

Comments
 (0)