Simplify IsWhitespace

This commit is contained in:
Ben Adams 2016-02-08 16:35:15 +00:00 committed by N. Taylor Mullen
parent fd11d70fcd
commit a493a9756e
1 changed files with 4 additions and 10 deletions

View File

@ -328,22 +328,16 @@ namespace Microsoft.AspNetCore.Mvc.Razor.TagHelpers
private static bool IsCharWhitespace(char ch) private static bool IsCharWhitespace(char ch)
{ {
var i = 0; for (var i = 0; i < ValidAttributeWhitespaceChars.Length; i++)
for (; i < ValidAttributeWhitespaceChars.Length; i++)
{ {
if (ValidAttributeWhitespaceChars[i] == ch) if (ValidAttributeWhitespaceChars[i] == ch)
{ {
break; return true;
} }
} }
if (i == ValidAttributeWhitespaceChars.Length)
{
// the character is not white space // the character is not white space
return false; return false;
} }
return true;
}
private class EncodeFirstSegmentContent : IHtmlContent private class EncodeFirstSegmentContent : IHtmlContent
{ {