Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-strecker-sonarsource committed Oct 17, 2023
1 parent 3386603 commit 12b6f93
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ internal static bool CanWrapObject(object obj, Type underlyingType)

ConcurrentDictionary<Type, bool> wrappedObject = SupportedObjectWrappers.GetOrAdd(underlyingType, static _ => new ConcurrentDictionary<Type, bool>());

// Avoid creating the delegate and capture class
// Avoid creating a delegate and capture class
if (!wrappedObject.TryGetValue(obj.GetType(), out var canCast))
{
canCast = underlyingType.GetTypeInfo().IsAssignableFrom(obj.GetType().GetTypeInfo());
Expand All @@ -93,7 +93,7 @@ internal static bool CanWrapNode(SyntaxNode node, Type underlyingType)

ConcurrentDictionary<SyntaxKind, bool> wrappedSyntax = SupportedSyntaxWrappers.GetOrAdd(underlyingType, static _ => new ConcurrentDictionary<SyntaxKind, bool>());

// Avoid creating the delegate and capture class
// Avoid creating a delegate and capture class
if (!wrappedSyntax.TryGetValue(node.Kind(), out var canCast))
{
canCast = underlyingType.GetTypeInfo().IsAssignableFrom(node.GetType().GetTypeInfo());
Expand All @@ -119,7 +119,7 @@ internal static bool CanWrapOperation(IOperation operation, Type underlyingType)

ConcurrentDictionary<OperationKind, bool> wrappedSyntax = SupportedOperationWrappers.GetOrAdd(underlyingType, static _ => new ConcurrentDictionary<OperationKind, bool>());

// Avoid creating the delegate and capture class
// Avoid creating a delegate and capture class
if (!wrappedSyntax.TryGetValue(operation.Kind, out var canCast))
{
canCast = underlyingType.GetTypeInfo().IsAssignableFrom(operation.GetType().GetTypeInfo());
Expand Down

0 comments on commit 12b6f93

Please sign in to comment.