Skip to content

Commit

Permalink
Account for the fact that envPrefix is never null.
Browse files Browse the repository at this point in the history
  • Loading branch information
Emzi0767 committed Sep 30, 2020
1 parent bea66b6 commit 7f8a0a2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private static string NormalizeKey(string key)
return key.Replace("__", ConfigurationPath.KeyDelimiter);
}

private static IEnumerable<DictionaryEntry> AzureEnvToAppEnv(DictionaryEntry entry, string envPrefix = default)
private static IEnumerable<DictionaryEntry> AzureEnvToAppEnv(DictionaryEntry entry, string envPrefix)
{
string key = (string)entry.Key;
string prefix = string.Empty;
Expand Down Expand Up @@ -100,7 +100,7 @@ private static IEnumerable<DictionaryEntry> AzureEnvToAppEnv(DictionaryEntry ent
{
// This prevents the prefix from being normalized.
// We can also do a fast path branch, I guess? No point in reallocating if the prefix is empty.
entry.Key = !string.IsNullOrEmpty(envPrefix)
entry.Key = envPrefix != string.Empty
? envPrefix + NormalizeKey(key.Substring(envPrefix.Length))
: NormalizeKey(key);

Expand Down

0 comments on commit 7f8a0a2

Please sign in to comment.