Skip to content

Commit

Permalink
fix: homoint: some int may cause stack overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
guimc233 committed Feb 23, 2024
1 parent 5904dc0 commit 5f3a001
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/ltd/guimc/lgzbot/utils/HomoIntUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ object HomoIntUtils {
)

if (num < 0) {
sum = "(${getInt(-1)})*(${getInt((-1) * num)})"
return "(${getInt(-1)})*(${getInt((-1) * num)})"
}

var temp: Long
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

public class Test {
public static void main(String[] args) {
System.out.println(HomoIntUtils.INSTANCE.getInt(71264112319847L));
System.out.println(HomoIntUtils.INSTANCE.getInt(-8964));
}
}

0 comments on commit 5f3a001

Please sign in to comment.