Dispose command line args enumerator
This commit is contained in:
Родитель
e53f86abe5
Коммит
d8f96d72e8
|
@ -46,7 +46,8 @@ namespace Microsoft.Extensions.Configuration.CommandLine
|
||||||
var data = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
var data = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||||
string key, value;
|
string key, value;
|
||||||
|
|
||||||
var enumerator = Args.GetEnumerator();
|
using (var enumerator = Args.GetEnumerator())
|
||||||
|
{
|
||||||
while (enumerator.MoveNext())
|
while (enumerator.MoveNext())
|
||||||
{
|
{
|
||||||
var currentArg = enumerator.Current;
|
var currentArg = enumerator.Current;
|
||||||
|
@ -128,6 +129,7 @@ namespace Microsoft.Extensions.Configuration.CommandLine
|
||||||
// Override value when key is duplicated. So we always have the last argument win.
|
// Override value when key is duplicated. So we always have the last argument win.
|
||||||
data[key] = value;
|
data[key] = value;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Data = data;
|
Data = data;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче