Skip to content

Commit 63d8ea2

Browse files
author
linzhijun
committed
优化代码
1 parent 0d3a82f commit 63d8ea2

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

csharp/ToolGood.Algorithm2/Internals/MathVisitor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1731,7 +1731,8 @@ public virtual Operand VisitDATEVALUE_fun(mathParser.DATEVALUE_funContext contex
17311731
{
17321732
var args = new List<Operand>();
17331733
foreach (var item in context.expr()) { var aa = item.Accept(this); if (aa.IsError) { return aa; } args.Add(aa); }
1734-
int type = 0;
1734+
if (args[0].Type == OperandType.DATE) { return args[0]; }
1735+
int type = 0;
17351736
if (args.Count == 2) {
17361737
var secondValue = args[1].ToNumber("Function DATEVALUE parameter 2 is error!");
17371738
if (secondValue.IsError) { return secondValue; }

csharp/ToolGood.Algorithm2/ToolGood.Algorithm2.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<Product>ToolGood.Algorithm</Product>
2121
<PackageLicenseFile>LICENSE</PackageLicenseFile>
2222
<SignAssembly>true</SignAssembly>
23-
<Version>3.4.1</Version>
23+
<Version>3.4.1.1</Version>
2424
<AssemblyOriginatorKeyFile>ToolGood.Algorithm.snk</AssemblyOriginatorKeyFile>
2525
<DelaySign>false</DelaySign>
2626
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\ToolGood.Algorithm.xml</DocumentationFile>

java/toolgood.algorithm/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.github.toolgood</groupId>
88
<artifactId>toolgood-algorithm</artifactId>
9-
<version>3.4.1.0</version>
9+
<version>3.4.1.1</version>
1010
<packaging>jar</packaging>
1111

1212
<name>toolgood.algorithm</name>

java/toolgood.algorithm/src/main/java/toolgood/algorithm/internals/MathVisitor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2356,7 +2356,8 @@ public Operand visitDATEVALUE_fun(final DATEVALUE_funContext context) {
23562356
}
23572357
args.add(aa);
23582358
}
2359-
int type = 0;
2359+
if (args.get(0).Type() == OperandType.DATE) { return args.get(0); }
2360+
int type = 0;
23602361
if (args.size() == 2) {
23612362
Operand secondValue = args.get(1).ToNumber("Function DATEVALUE parameter 2 is error!");
23622363
if (secondValue.IsError()) {

0 commit comments

Comments
 (0)