@@ -543,6 +543,7 @@ public override Operand Evaluate(AlgorithmEngine work, Func<string, Operand> tem
543543 if ( args1 . IsNumber && args2 . IsNumber ) { // 优化性能
544544 if ( args1 . NumberValue == 1 ) { return args2 ; }
545545 if ( args2 . NumberValue == 1 ) { return args1 ; }
546+ if ( args1 . NumberValue == 0 || args2 . NumberValue == 0 ) { return Operand . Zero ; }
546547 return Operand . Create ( args1 . NumberValue * args2 . NumberValue ) ;
547548 }
548549
@@ -939,10 +940,7 @@ public override Operand Evaluate(AlgorithmEngine work, Func<string, Operand> tem
939940 } else {
940941 return Operand . Error ( "Function '==' compare is error." ) ;
941942 }
942- } else if ( args1 . IsJson || args2 . IsJson
943- || args1 . IsArray || args2 . IsArray
944- || args1 . IsArrayJson || args2 . IsArrayJson
945- ) {
943+ } else if ( args1 . IsJson || args2 . IsJson || args1 . IsArray || args2 . IsArray || args1 . IsArrayJson || args2 . IsArrayJson ) {
946944 return Operand . Error ( "Function '==' compare is error." ) ;
947945 }
948946 if ( args1 . IsNotNumber ) { args1 = args1 . ToNumber ( "Function '{0}' parameter {1} is error!" , "==" , 1 ) ; if ( args1 . IsError ) { return args1 ; } }
@@ -1004,10 +1002,7 @@ public override Operand Evaluate(AlgorithmEngine work, Func<string, Operand> tem
10041002 } else {
10051003 return Operand . Error ( "Function '!=' compare is error." ) ;
10061004 }
1007- } else if ( args1 . IsJson || args2 . IsJson
1008- || args1 . IsArray || args2 . IsArray
1009- || args1 . IsArrayJson || args2 . IsArrayJson
1010- ) {
1005+ } else if ( args1 . IsJson || args2 . IsJson || args1 . IsArray || args2 . IsArray || args1 . IsArrayJson || args2 . IsArrayJson ) {
10111006 return Operand . Error ( "Function '!=' compare is error." ) ;
10121007 }
10131008 if ( args1 . IsNotNumber ) { args1 = args1 . ToNumber ( "Function '{0}' parameter {1} is error!" , "!=" , 1 ) ; if ( args1 . IsError ) { return args1 ; } }
@@ -1073,10 +1068,7 @@ public override Operand Evaluate(AlgorithmEngine work, Func<string, Operand> tem
10731068 } else {
10741069 return Operand . Error ( "Function '>=' compare is error." ) ;
10751070 }
1076- } else if ( args1 . IsJson || args2 . IsJson
1077- || args1 . IsArray || args2 . IsArray
1078- || args1 . IsArrayJson || args2 . IsArrayJson
1079- ) {
1071+ } else if ( args1 . IsJson || args2 . IsJson || args1 . IsArray || args2 . IsArray || args1 . IsArrayJson || args2 . IsArrayJson ) {
10801072 return Operand . Error ( "Function '>=' compare is error." ) ;
10811073 }
10821074 if ( args1 . IsNotNumber ) { args1 = args1 . ToNumber ( "Function '{0}' parameter {1} is error!" , ">=" , 1 ) ; if ( args1 . IsError ) { return args1 ; } }
@@ -1141,10 +1133,7 @@ public override Operand Evaluate(AlgorithmEngine work, Func<string, Operand> tem
11411133 } else {
11421134 return Operand . Error ( "Function '<=' compare is error." ) ;
11431135 }
1144- } else if ( args1 . IsJson || args2 . IsJson
1145- || args1 . IsArray || args2 . IsArray
1146- || args1 . IsArrayJson || args2 . IsArrayJson
1147- ) {
1136+ } else if ( args1 . IsJson || args2 . IsJson || args1 . IsArray || args2 . IsArray || args1 . IsArrayJson || args2 . IsArrayJson ) {
11481137 return Operand . Error ( "Function '<=' compare is error." ) ;
11491138 }
11501139 if ( args1 . IsNotNumber ) { args1 = args1 . ToNumber ( "Function '{0}' parameter {1} is error!" , "<=" , 1 ) ; if ( args1 . IsError ) { return args1 ; } }
@@ -1210,10 +1199,7 @@ public override Operand Evaluate(AlgorithmEngine work, Func<string, Operand> tem
12101199 } else {
12111200 return Operand . Error ( "Function '>' compare is error." ) ;
12121201 }
1213- } else if ( args1 . IsJson || args2 . IsJson
1214- || args1 . IsArray || args2 . IsArray
1215- || args1 . IsArrayJson || args2 . IsArrayJson
1216- ) {
1202+ } else if ( args1 . IsJson || args2 . IsJson || args1 . IsArray || args2 . IsArray || args1 . IsArrayJson || args2 . IsArrayJson ) {
12171203 return Operand . Error ( "Function '>' compare is error." ) ;
12181204 }
12191205 if ( args1 . IsNotNumber ) { args1 = args1 . ToNumber ( "Function '{0}' parameter {1} is error!" , ">" , 1 ) ; if ( args1 . IsError ) { return args1 ; } }
0 commit comments