Skip to content

Commit ff06f3b

Browse files
author
linzhijun
committed
fix
1 parent b7060a6 commit ff06f3b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

csharp/ToolGood.Algorithm/Operand.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ public static Operand Create(List<Operand> obj)
334334
/// <returns></returns>
335335
public static Operand Create(ICollection<string> obj)
336336
{
337-
var array = new List<Operand>();
337+
var array = new List<Operand>(obj.Count);
338338
foreach(var item in obj) {
339339
array.Add(Create(item));
340340
}
@@ -348,7 +348,7 @@ public static Operand Create(ICollection<string> obj)
348348
/// <returns></returns>
349349
public static Operand Create(ICollection<double> obj)
350350
{
351-
var array = new List<Operand>();
351+
var array = new List<Operand>(obj.Count);
352352
foreach(var item in obj) {
353353
array.Add(Create(item));
354354
}
@@ -362,7 +362,7 @@ public static Operand Create(ICollection<double> obj)
362362
/// <returns></returns>
363363
public static Operand Create(ICollection<int> obj)
364364
{
365-
var array = new List<Operand>();
365+
var array = new List<Operand>(obj.Count);
366366
foreach(var item in obj) {
367367
array.Add(Create(item));
368368
}
@@ -376,7 +376,7 @@ public static Operand Create(ICollection<int> obj)
376376
/// <returns></returns>
377377
public static Operand Create(ICollection<bool> obj)
378378
{
379-
var array = new List<Operand>();
379+
var array = new List<Operand>(obj.Count);
380380
foreach(var item in obj) {
381381
array.Add(Create(item));
382382
}

0 commit comments

Comments
 (0)