Skip to content

Commit 65aee74

Browse files
committed
Removed code clone in ObjectFiller.Create(int).
1 parent 73b6dac commit 65aee74

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

ObjectFiller/Filler.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,9 @@ public T Create()
8686
public IEnumerable<T> Create(int count)
8787
{
8888
IList<T> items = new List<T>();
89-
var typeStack = new HashStack<Type>();
90-
Type targetType = typeof(T);
9189
for (int n = 0; n < count; n++)
9290
{
93-
T objectToFill;
94-
if (!TypeIsClrType(targetType))
95-
{
96-
objectToFill = (T)this.CreateInstanceOfType(targetType, this.setupManager.GetFor<T>(), typeStack);
97-
this.Fill(objectToFill);
98-
}
99-
else
100-
{
101-
objectToFill = (T)this.CreateAndFillObject(typeof(T), this.setupManager.GetFor<T>(), typeStack);
102-
}
103-
104-
items.Add(objectToFill);
91+
items.Add(this.Create());
10592
}
10693

10794
return items;

0 commit comments

Comments
 (0)