Skip to content

Commit f22c18a

Browse files
committed
use if instead of math methods
1 parent c1ecb3c commit f22c18a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

framework/src/main/java/org/tron/core/services/event/BlockEventLoad.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ public synchronized void load() throws Exception {
6969
if (cacheHeadNum >= tmpNum) {
7070
return;
7171
}
72-
tmpNum = Math.min(tmpNum, cacheHeadNum + MAX_LOAD_NUM);
72+
if (tmpNum > cacheHeadNum + MAX_LOAD_NUM) {
73+
tmpNum = cacheHeadNum + MAX_LOAD_NUM;
74+
}
7375
List<BlockEvent> l1 = new ArrayList<>();
7476
List<BlockEvent> l2 = new ArrayList<>();
7577
BlockEvent tmp = BlockEventCache.getHead();

0 commit comments

Comments
 (0)