Skip to content

Commit

Permalink
fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
dao-jun committed Mar 9, 2024
1 parent dbcfffa commit 7e41819
Showing 1 changed file with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4547,22 +4547,14 @@ public void checkCursorsToCacheEntries() {
* @param publishTime
*/
protected void updatePublishTimestamp(long ledgerId, long publishTime) {
MutablePair<Long, Long> pair = ledgerPublishTimeMap.computeIfAbsent(ledgerId, k -> MutablePair.of(null, null));
Long start = pair.getLeft();
Long end = pair.getRight();
if (start == null) {
MutablePair<Long, Long> pair = ledgerPublishTimeMap.computeIfAbsent(ledgerId, k -> MutablePair.of(Long.MAX_VALUE, Long.MIN_VALUE));
long start = pair.getLeft();
long end = pair.getRight();
if (publishTime < start) {
pair.setLeft(publishTime);
} else {
if (publishTime < start) {
pair.setLeft(publishTime);
}
}
if (end == null) {
if (publishTime > end) {
pair.setRight(publishTime);
} else {
if (publishTime > end) {
pair.setRight(publishTime);
}
}
}

Expand Down

0 comments on commit 7e41819

Please sign in to comment.