Remove some allocations related to logging configuration (#50055)
authorDavid Fowler <davidfowl@gmail.com>
Tue, 23 Mar 2021 02:29:17 +0000 (19:29 -0700)
committerGitHub <noreply@github.com>
Tue, 23 Mar 2021 02:29:17 +0000 (22:29 -0400)
commitc86c1ecb253a5c79f22d114579b7a0b237f8ec00
tree9c73c9e69eac621f1bb5a5716b9d24eec89fcb50
parentd0ff5ca12a0c8a436b8180d1b2087e5fc58fb6d8
Remove some allocations related to logging configuration (#50055)

* Remove some allocations related to logging configuration
- Today we allocate enumerators when enumerating custom attributes, this changes a for loop into a foreach and removes the inner foreach loop.

* Remove enumerator allocation from rules selector

* Make condition clearer

* Update src/libraries/Microsoft.Extensions.Logging/src/LoggerFilterOptions.cs

Co-authored-by: Jonas Nyrup <78789299+jn-foreflight@users.noreply.github.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Jonas Nyrup <78789299+jn-foreflight@users.noreply.github.com>
src/libraries/Common/src/Extensions/ProviderAliasUtilities/ProviderAliasUtilities.cs
src/libraries/Microsoft.Extensions.Logging/src/LoggerFilterOptions.cs
src/libraries/Microsoft.Extensions.Logging/src/LoggerRuleSelector.cs