Skip to content

Commit 5d688a0

Browse files
committed
feat(*): remove redundant boxing
1 parent e42cb35 commit 5d688a0

File tree

7 files changed

+8
-9
lines changed

7 files changed

+8
-9
lines changed

actuator/src/main/java/org/tron/core/vm/program/invoke/ProgramInvokeImpl.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public boolean equals(Object o) {
314314

315315
@Override
316316
public int hashCode() {
317-
return Integer.valueOf(Boolean.valueOf(byTestingSuite).hashCode()
317+
return Boolean.valueOf(byTestingSuite).hashCode()
318318
+ Boolean.valueOf(byTransaction).hashCode()
319319
+ address.hashCode()
320320
+ balance.hashCode()
@@ -326,8 +326,7 @@ public int hashCode() {
326326
+ origin.hashCode()
327327
+ prevHash.hashCode()
328328
+ deposit.hashCode()
329-
+ timestamp.hashCode()
330-
).hashCode();
329+
+ timestamp.hashCode();
331330
}
332331

333332
@Override

actuator/src/main/java/org/tron/core/vm/repository/Type.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public boolean equals(Object obj) {
7373

7474
@Override
7575
public int hashCode() {
76-
return Integer.valueOf(type).hashCode();
76+
return type;
7777
}
7878

7979
@Override

actuator/src/main/java/org/tron/core/vm/repository/Value.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ public boolean equals(Object obj) {
5858

5959
@Override
6060
public int hashCode() {
61-
return Integer.valueOf(type.hashCode() + Objects.hashCode(value)).hashCode();
61+
return type.hashCode() + Objects.hashCode(value);
6262
}
6363
}

crypto/src/main/java/org/tron/common/crypto/zksnark/Fp12.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ public boolean equals(Object o) {
356356

357357
@Override
358358
public int hashCode() {
359-
return Integer.valueOf(a.hashCode() + b.hashCode()).hashCode();
359+
return a.hashCode() + b.hashCode();
360360
}
361361

362362
@Override

crypto/src/main/java/org/tron/common/crypto/zksnark/Fp2.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public boolean equals(Object o) {
164164

165165
@Override
166166
public int hashCode() {
167-
return Integer.valueOf(a.hashCode() + b.hashCode()).hashCode();
167+
return a.hashCode() + b.hashCode();
168168
}
169169

170170
Fp2 frobeniusMap(int power) {

crypto/src/main/java/org/tron/common/crypto/zksnark/Fp6.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,6 @@ public boolean equals(Object o) {
246246

247247
@Override
248248
public int hashCode() {
249-
return Integer.valueOf(a.hashCode() + b.hashCode() + c.hashCode()).hashCode();
249+
return a.hashCode() + b.hashCode() + c.hashCode();
250250
}
251251
}

framework/src/main/java/org/tron/core/services/http/GetProposalByIdServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) {
2626
try {
2727
boolean visible = Util.getVisible(request);
2828
String input = request.getParameter("id");
29-
long id = Long.valueOf(input);
29+
long id = Long.parseLong(input);
3030
fillResponse(ByteString.copyFrom(ByteArray.fromLong(id)), visible, response);
3131
} catch (Exception e) {
3232
Util.processError(e, response);

0 commit comments

Comments
 (0)