Skip to content

Commit

Permalink
Remove extra checks for known types in log formatter (#89000)
Browse files Browse the repository at this point in the history
Turns out the JIT will not box in tier 1, this was trying to optimize tier 0 code.
  • Loading branch information
davidfowl committed Jul 17, 2023
1 parent d4caa91 commit fad5bd9
Showing 1 changed file with 0 additions and 7 deletions.
Expand Up @@ -265,13 +265,6 @@ private static object FormatArgument(object? value)

private static bool TryFormatArgumentIfNullOrEnumerable<T>(T? value, [NotNullWhen(true)] ref object? stringValue)
{
// Avoiding boxing of known types
if (typeof(T).IsPrimitive || typeof(T).IsEnum)
{
stringValue = null;
return false;
}

if (value == null)
{
stringValue = NullValue;
Expand Down

0 comments on commit fad5bd9

Please sign in to comment.