修复了条件表达式".xxx<bool> = true/false"执行了错误分支,优化了流程的运行。

This commit is contained in:
fengjiayi
2024-12-16 00:58:45 +08:00
parent 8d0258ebea
commit 0372e1fc23
8 changed files with 57 additions and 46 deletions

View File

@@ -18,20 +18,22 @@ namespace Serein.Library.Utils.SereinExpression.Resolver
public Operator Op { get; set; }
public bool Value { get; set; }
public bool Data { get; set; }
public override bool Evaluate(object obj)
{
if (obj is bool boolObj)
{
return boolObj == Value;
/*switch (Op)
{
case Operator.Is:
return boolObj == Value;
}*/
}
return false;
return Value.Equals(Data);
//if (obj is bool boolObj && Value is bool boolValue)
//{
// /*switch (Op)
// {
// case Operator.Is:
// return boolObj == Value;
// }*/
//}
//return false;
}
}