Skip to content

Commit d72cbf3

Browse files
authored
fix(CodeQL): revert implicit narrowing conversion (#6466)
1 parent 9429b82 commit d72cbf3

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

chainbase/src/main/java/org/tron/core/service/MortgageService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ private long computeReward(long cycle, List<Pair<byte[], Long>> votes) {
182182
}
183183
long userVote = vote.getValue();
184184
double voteRate = (double) userVote / totalVote;
185-
reward += (long) (voteRate * totalReward);
185+
reward += voteRate * totalReward;
186186
}
187187
return reward;
188188
}

crypto/src/main/java/org/tron/common/crypto/Rsv.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static Rsv fromSignature(byte[] sign) {
1919
byte[] s = Arrays.copyOfRange(sign, 32, 64);
2020
byte v = sign[64];
2121
if (v < 27) {
22-
v += (byte) 27; //revId -> v
22+
v += 27; //revId -> v
2323
}
2424
return new Rsv(r, s, v);
2525
}

framework/src/main/java/org/tron/core/capsule/utils/RLP.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static short decodeShort(byte[] data, int index) {
165165
byte pow = (byte) (length - 1);
166166
for (int i = 1; i <= length; ++i) {
167167
// << (8 * pow) == bit shift to 0 (*1), 8 (*256) , 16 (*65..)
168-
value += (short) ((data[index + i] & 0xFF) << (8 * pow));
168+
value += (data[index + i] & 0xFF) << (8 * pow);
169169
pow--;
170170
}
171171
} else {

framework/src/main/java/org/tron/core/zen/address/SpendingKey.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public DiversifierT defaultDiversifier() throws BadItemException, ZksnarkExcepti
8989
throw new BadItemException(
9090
"librustzcash_check_diversifier does not return valid diversifier");
9191
}
92-
blob[33] += (byte) 1;
92+
blob[33] += 1;
9393
} finally {
9494
JLibsodium.freeState(state);
9595
}

0 commit comments

Comments
 (0)