Skip to content

Commit

Permalink
fixes code
Browse files Browse the repository at this point in the history
  • Loading branch information
gavingaozhangmin committed Aug 10, 2021
1 parent da5c606 commit 440a416
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -3218,10 +3218,10 @@ public PositionImpl getPreviousPosition(PositionImpl position) {
}
}

Map.Entry<Long, LedgerInfo> firstEntry = headMap.firstEntry();
if(firstEntry != null) {
Map.Entry<Long, LedgerInfo> firstLedgerEntry = headMap.firstEntry();
if(firstLedgerEntry != null) {
// in case there are only empty ledgers, we return a position in the first one
return PositionImpl.get(headMap.firstEntry().getKey(), -1);
return PositionImpl.get(firstLedgerEntry.getKey(), -1);
} else {
return PositionImpl.get(position.getLedgerId(), -1);
}
Expand Down

0 comments on commit 440a416

Please sign in to comment.