Skip to content

Commit

Permalink
changed for to foreach where applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
handrake committed Sep 12, 2017
1 parent 5fb885c commit 7c0e3ed
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions PUBGAddon/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ private void Form1_Load(object sender, EventArgs e)

serverList = new List<Tuple<String, List<Tuple<String, String>>>>();

for (int i = 0; i < tmpList.Count(); i++)
foreach (var t in tmpList)
{
serverList.Add(Tuple.Create(tmpList[i].Item1, new List<Tuple<String, String>>()));
for (int j = 0; j < tmpList[i].Item2.Count(); j = j + 2)
serverList.Add(Tuple.Create(t.Item1, new List<Tuple<String, String>>()));
for (int j = 0; j < t.Item2.Count(); j = j + 2)
{
serverList[i].Item2.Add(Tuple.Create(tmpList[i].Item2[j], tmpList[i].Item2[j + 1]));
serverList.Last().Item2.Add(Tuple.Create(t.Item2[j], t.Item2[j + 1]));
}
}

Expand Down Expand Up @@ -152,11 +152,11 @@ private void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArg

textBox2.Text = mostCommonIP;

for (int i = 0; i < serverList.Count(); i++)
foreach (var t in serverList)
{
if (serverList[i].Item2.Any(x => IsIPInRange(mostCommonIP.ToString(), x.Item1, x.Item2)))
if (t.Item2.Any(x => IsIPInRange(mostCommonIP.ToString(), x.Item1, x.Item2)))
{
textBox1.Text = serverList[i].Item1;
textBox1.Text = t.Item1;
goto End;
}
}
Expand Down

0 comments on commit 7c0e3ed

Please sign in to comment.