Skip to content

Commit 4668c9d

Browse files
committed
Remove for loop
1 parent 602fef6 commit 4668c9d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/FakeItEasy.AutoFakeIt/AutoFakeIt.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ public T Generate<T>() where T : class
2727
.ToList();
2828

2929
Exception? lastThrownException = null;
30-
for (var i = 0; i < constructors.Count; i++)
30+
foreach (var ctor in constructors)
3131
{
3232
try
3333
{
34-
var candidateFakeObjects = GenerateCandidateFakeObjects(constructors[i]);
34+
var candidateFakeObjects = GenerateCandidateFakeObjects(ctor);
3535

36-
var generatedObject = (T)constructors[i].Invoke(candidateFakeObjects.Values.ToArray());
36+
var generatedObject = (T)ctor.Invoke(candidateFakeObjects.Values.ToArray());
3737

3838
InsertMissingFakedObjects(candidateFakeObjects);
3939

0 commit comments

Comments
 (0)