Remove a String.Split

This commit is contained in:
Ryan Nowak 2016-01-15 10:18:40 -08:00
parent 95ea4cc06f
commit 08fef95969
1 changed files with 18 additions and 5 deletions

View File

@ -324,12 +324,25 @@ namespace Microsoft.AspNet.Razor.Parser.TagHelpers.Internal
childSpan = child as Span; childSpan = child as Span;
} }
var attributeName = childSpan var start = 0;
.Content for (; start < childSpan.Content.Length; start++)
.Split(separator: new[] { '=' }, count: 2)[0] {
.TrimStart(); if (!char.IsWhiteSpace(childSpan.Content[start]))
{
break;
}
}
attributeNames.Add(attributeName); var end = 0;
for (end = start; end < childSpan.Content.Length; end++)
{
if (childSpan.Content[end] == '=')
{
break;
}
}
attributeNames.Add(childSpan.Content.Substring(start, end - start));
} }
return attributeNames; return attributeNames;