Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Commit 8e839e7

Browse files
committed
Reinstate for loop over LINQ
1 parent d6fcb3b commit 8e839e7

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

UniqueFileGenerator/RandomStringFactory.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,10 @@ public string CreateUniqueString(int length)
7373

7474
var outputChars = new char[length];
7575

76-
//for (var i = 0; i < outputChars.Length; i++)
77-
//{
78-
// outputChars[i] = CharacterBank[Random.Next(CharacterBank.Length)];
79-
//}
80-
81-
Enumerable.Range(0, outputChars.Length)
82-
.ToList()
83-
.ForEach(i =>
84-
outputChars[i] = CharacterBank[Random.Next(CharacterBank.Length)]);
76+
for (var i = 0; i < outputChars.Length; i++)
77+
{
78+
outputChars[i] = CharacterBank[Random.Next(CharacterBank.Length)];
79+
}
8580

8681
return new string(outputChars);
8782
}

0 commit comments

Comments
 (0)