mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-24 12:35:31 +00:00
Change Remove function
use for instead foreach and Equals instead string compar
This commit is contained in:
parent
aa728c4835
commit
584568bceb
1 changed files with 4 additions and 6 deletions
|
|
@ -37,15 +37,13 @@ namespace Cosmos.System.Network.Config
|
||||||
/// <param name="config"></param>
|
/// <param name="config"></param>
|
||||||
public static void Remove(Address nameserver)
|
public static void Remove(Address nameserver)
|
||||||
{
|
{
|
||||||
int counter = 0;
|
for (int i = 0; i < DNSNameservers.Count; i++)
|
||||||
|
|
||||||
foreach (var ns in DNSNameservers)
|
|
||||||
{
|
{
|
||||||
if (ns.address.ToString() == nameserver.address.ToString())
|
if (DNSNameservers[i].address.Equals(nameserver))
|
||||||
{
|
{
|
||||||
DNSNameservers.RemoveAt(counter);
|
DNSNameservers.RemoveAt(i);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
counter++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue