Skip to content

Commit ce35a13

Browse files
committed
fix
1 parent 8227226 commit ce35a13

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

csharp/ToolGood.Algorithm/Internals/Functions/FunctionBase.flow.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
1+
using System.Text;
42
using ToolGood.Algorithm.Enums;
53

64
namespace ToolGood.Algorithm.Internals.Functions
@@ -15,7 +13,7 @@ public Function_IF(FunctionBase func1, FunctionBase func2, FunctionBase func3) :
1513

1614
public override Operand Calculate(AlgorithmEngine work)
1715
{
18-
var args1 = func1.Calculate(work); if (args1.Type != OperandType.BOOLEAN) { args1 = args1.ToBoolean("Function '{0}' parameter {1} is error!","If",1); if (args1.IsError) { return args1; } }
16+
var args1 = func1.Calculate(work); if (args1.Type != OperandType.BOOLEAN) { args1 = args1.ToBoolean("Function '{0}' parameter {1} is error!", "If", 1); if (args1.IsError) { return args1; } }
1917
if (args1.BooleanValue) return func2.Calculate(work);
2018
if (func3 == null) { return Operand.False; }
2119
return func3.Calculate(work);
@@ -235,7 +233,7 @@ public Function_NOT(FunctionBase func1) : base(func1)
235233
public override Operand Calculate(AlgorithmEngine work)
236234
{
237235
var args1 = func1.Calculate(work);
238-
if (args1.IsError) { return args1; }
236+
if (args1.Type != OperandType.BOOLEAN) { args1 = args1.ToBoolean("Function '{0}' parameter is error!", "Not"); if (args1.IsError) { return args1; } }
239237
return args1.BooleanValue ? Operand.False : Operand.True;
240238
}
241239
public override void ToString(StringBuilder stringBuilder, bool addBrackets)

csharp/ToolGood.Algorithm/Internals/Functions/FunctionBase.value.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Reflection;
1+
using System.Collections.Generic;
42
using System.Text;
53
using ToolGood.Algorithm.Enums;
64

0 commit comments

Comments
 (0)