Skip to content

Commit

Permalink
Reduce creation of static objects (dotnet#36867)
Browse files Browse the repository at this point in the history
  • Loading branch information
lindexi authored Jun 28, 2020
1 parent c6d1756 commit 2981ad9
Showing 1 changed file with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class NullLogger<T> : ILogger<T>
/// <inheritdoc />
public IDisposable BeginScope<TState>(TState state)
{
return NullDisposable.Instance;
return NullScope.Instance;
}

/// <inheritdoc />
Expand All @@ -41,15 +41,5 @@ public bool IsEnabled(LogLevel logLevel)
{
return false;
}

private class NullDisposable : IDisposable
{
public static readonly NullDisposable Instance = new NullDisposable();

public void Dispose()
{
// intentionally does nothing
}
}
}
}

0 comments on commit 2981ad9

Please sign in to comment.