Skip to content

Commit

Permalink
Remove redundant call to ConvertToCanonForm (#88171)
Browse files Browse the repository at this point in the history
Call to `type.ConvertToCanonForm(CanonicalFormKind.Specific)` is redundant as we just computed the `canonType` two lines up. Reuse the computed value

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
  • Loading branch information
IDisposable and MichalStrehovsky committed Jun 29, 2023
1 parent 8899ed4 commit eccca2f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ internal static void AddSignatureDependency(ref DependencyList dependencies, Nod

TypeDesc canonType = type.ConvertToCanonForm(CanonicalFormKind.Specific);
if (canonType.IsCanonicalSubtype(CanonicalFormKind.Any))
GenericTypesTemplateMap.GetTemplateTypeDependencies(ref dependencies, factory, type.ConvertToCanonForm(CanonicalFormKind.Specific));
GenericTypesTemplateMap.GetTemplateTypeDependencies(ref dependencies, factory, canonType);
else
dependencies.Add(factory.MaximallyConstructableType(canonType), reason);
dependencies.Add(factory.MaximallyConstructableType(type), reason);
}

public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false)
Expand Down

0 comments on commit eccca2f

Please sign in to comment.