Remove a String.Split
This commit is contained in:
parent
95ea4cc06f
commit
08fef95969
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue