sashapolo commented on code in PR #5684:
URL: https://github.com/apache/ignite-3/pull/5684#discussion_r2059638991
##########
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/KeyValueStorageUtils.java:
##########
@@ -43,14 +43,20 @@ public static int indexToCompact(long[] keyRevisions, long
compactionRevisionInc
int i = binarySearch(keyRevisions, compactionRevisionInclusive);
if (i < 0) {
- if (i == -1) {
+ i = ~i;
+
+ if (i == 0) {
return NOT_FOUND;
}
- i = -(i + 2);
+ i--;
}
- if (i == keyRevisions.length - 1 &&
!isTombstone.test(keyRevisions[i])) {
+ if (!isTombstone.test(keyRevisions[i])) {
Review Comment:
I forgot that you decrease `i` in this scenario, my bad
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]