Skip to content

Commit

Permalink
simplify EnvironmentVariablesConfigurationProvider.Load
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Jan 23, 2025
1 parent ef090ad commit 62e59e2
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,11 @@ internal void Load(IDictionary envVariables)
{
var data = new Dictionary<string, string?>(StringComparer.OrdinalIgnoreCase);

IDictionaryEnumerator e = envVariables.GetEnumerator();
try
foreach (DictionaryEntry entry in envVariables)
{
while (e.MoveNext())
{
string key = (string)e.Entry.Key;
string? value = (string?)e.Entry.Value;
AddIfNormalizedKeyMatchesPrefix(data, Normalize(key), value);
}
}
finally
{
(e as IDisposable)?.Dispose();
string key = (string)entry.Key;
string? value = (string?)entry.Value;
AddIfNormalizedKeyMatchesPrefix(data, Normalize(key), value);
}

Data = data;
Expand Down

0 comments on commit 62e59e2

Please sign in to comment.