Skip to content

Commit

Permalink
Optimize Type.IsPrimitive (#42891)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo authored Sep 30, 2020
1 parent 13b457a commit 8ffc0b3
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,7 @@ internal static bool IsTypeDefinition(RuntimeType type)

internal static bool IsPrimitive(RuntimeType type)
{
CorElementType corElemType = GetCorElementType(type);
return (corElemType >= CorElementType.ELEMENT_TYPE_BOOLEAN && corElemType <= CorElementType.ELEMENT_TYPE_R8) ||
corElemType == CorElementType.ELEMENT_TYPE_I ||
corElemType == CorElementType.ELEMENT_TYPE_U;
return RuntimeHelpers.IsPrimitiveType(GetCorElementType(type));
}

internal static bool IsByRef(RuntimeType type)
Expand Down

0 comments on commit 8ffc0b3

Please sign in to comment.