зеркало из https://github.com/dotnet/razor.git
Convert to ImmutableArray<T> to avoid extra LINQ evaluation
This commit is contained in:
Родитель
4981b46ff3
Коммит
43b1176f39
|
@ -64,9 +64,17 @@ internal class DefaultTagHelperDescriptorFactory
|
|||
|
||||
private static void AddTagMatchingRules(INamedTypeSymbol type, TagHelperDescriptorBuilder descriptorBuilder)
|
||||
{
|
||||
var targetElementAttributes = type
|
||||
.GetAttributes()
|
||||
.Where(static attribute => attribute.AttributeClass.HasFullName(TagHelperTypes.HtmlTargetElementAttribute));
|
||||
using var builder = new PooledArrayBuilder<AttributeData>();
|
||||
|
||||
foreach (var attribute in type.GetAttributes())
|
||||
{
|
||||
if (attribute.AttributeClass.HasFullName(TagHelperTypes.HtmlTargetElementAttribute))
|
||||
{
|
||||
builder.Add(attribute);
|
||||
}
|
||||
}
|
||||
|
||||
var targetElementAttributes = builder.ToImmutable();
|
||||
|
||||
// If there isn't an attribute specifying the tag name derive it from the name
|
||||
if (!targetElementAttributes.Any())
|
||||
|
|
Загрузка…
Ссылка в новой задаче