Skip to content

Commit 4889a13

Browse files
author
linzhijun
committed
fix
1 parent 57d26ad commit 4889a13

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

csharp/ToolGood.Algorithm/Internals/Functions/Csharp/Function_LOOKFLOOR.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public override Operand Evaluate(AlgorithmEngine engine, Func<AlgorithmEngine, s
2626
List<decimal> list = new List<decimal>();
2727
FunctionUtil.F_base_GetList(args2, list);
2828
if(list.Count == 0) { return ParameterError(2); }
29-
list = list.OrderBy(n => n).ToList();
29+
list.Sort();
3030
var value = args1.NumberValue;
3131
var result = list[0];
3232
if(result == value) { return args1; }

csharp/ToolGood.Algorithm/Internals/Functions/MathSum/Function_MEDIAN.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public override Operand Evaluate(AlgorithmEngine engine, Func<AlgorithmEngine, s
2323
if (o == false) { return FunctionError(); }
2424
if (list.Count == 0) { return FunctionError(); }
2525

26-
list = list.OrderBy(q => q).ToList();
26+
list.Sort();
2727
return Operand.Create(list[list.Count / 2]);
2828
}
2929

csharp/ToolGood.Algorithm/Internals/Functions/MathSum/Function_SMALL.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public override Operand Evaluate(AlgorithmEngine engine, Func<AlgorithmEngine, s
2828
var list = new List<decimal>();
2929
var o = FunctionUtil.F_base_GetList(args1, list);
3030
if(o == false) { return ParameterError(1); }
31-
list = list.OrderBy(q => q).ToList();
31+
list.Sort();
3232
int k = args2.IntValue;
3333
if(k < 1 - engine.ExcelIndex || k > list.Count - engine.ExcelIndex) {
3434
return ParameterError(2);

0 commit comments

Comments
 (0)