Skip to content

Commit a998769

Browse files
committed
If it walks like a for loop and quacks like a for loop...
1 parent 95b7c77 commit a998769

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ private static ImmutableArray<TextSpan> TokenizeWords(SourceText text)
5959
// whitespace characters in the same "word", and we don't really care about contiguous quotes
6060
// or slashes, so we can keep it simple and just capture a "word" when the classification of
6161
// the current character changes.
62-
var index = 1;
63-
while (index < text.Length)
62+
for (var index = 1; index < text.Length; index++)
6463
{
6564
var classification = Classify(text[index]);
6665
if (classification != currentClassification)
@@ -70,8 +69,6 @@ private static ImmutableArray<TextSpan> TokenizeWords(SourceText text)
7069
currentSpanStart = index;
7170
currentClassification = classification;
7271
}
73-
74-
index++;
7572
}
7673

7774
// It's impossible for the loop to capture the last word

0 commit comments

Comments
 (0)