Skip to content

Commit c079f4d

Browse files
CR Feedback: Clean up loop
1 parent f091572 commit c079f4d

File tree

1 file changed

+6
-6
lines changed
  • src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Syntax

1 file changed

+6
-6
lines changed

src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Syntax/GreenNode.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,15 +232,15 @@ public override string ToString()
232232
return token.Content;
233233
}
234234

235-
// If this is a zero-width token, skip it.
236-
if (token.Width == 0)
235+
// At this point, if this is a zero-width token, we know there must be more
236+
// non-zero-width tokens. Break out of the loop to allocate a new string with all
237+
// of the content.
238+
if (token.Width != 0)
237239
{
238-
continue;
240+
break;
239241
}
240242

241-
// Otherwise, this is a non-zero-width token but there much be more tokens that make up the
242-
// total width. Break out of the loop to allocate a new string with all of the content.
243-
break;
243+
// This was just a zero-width token - continue looping.
244244
}
245245

246246
// At this point, we know that we have multiple tokens and need to allocate a string.

0 commit comments

Comments
 (0)