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