Skip to content

Commit

Permalink
Remove for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
akamud committed Jun 23, 2021
1 parent 602fef6 commit 4668c9d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/FakeItEasy.AutoFakeIt/AutoFakeIt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ public T Generate<T>() where T : class
.ToList();

Exception? lastThrownException = null;
for (var i = 0; i < constructors.Count; i++)
foreach (var ctor in constructors)
{
try
{
var candidateFakeObjects = GenerateCandidateFakeObjects(constructors[i]);
var candidateFakeObjects = GenerateCandidateFakeObjects(ctor);

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

InsertMissingFakedObjects(candidateFakeObjects);

Expand Down

0 comments on commit 4668c9d

Please sign in to comment.