rpuch commented on code in PR #6964:
URL: https://github.com/apache/ignite-3/pull/6964#discussion_r2527419992
##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/impl/TestMvPartitionStorage.java:
##########
@@ -631,9 +633,30 @@ public ReadResult next() {
}
@Override
- public @Nullable RowMeta closestRow(RowId lowerBound) throws
StorageException {
+ public List<RowMeta> rowsStartingWith(RowId lowerBound, int limit) throws
StorageException {
checkStorageClosedOrInProcessOfRebalance();
+ List<RowMeta> result = new ArrayList<>();
+ RowId currentLowerBound = lowerBound;
+ for (int i = 0; i < limit; i++) {
+ RowMeta row = closestRow(currentLowerBound);
+
+ if (row == null) {
+ break;
Review Comment:
The idiom 'break the loop and let the code that follows finalize whatever
has to be done then' is conceptually simpler, in my opinion, that's why I used
it here. The early return pattern is sometimes beneficial, but here it doesn't
seem to bring any value. I would prefer to leave it as is
--
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]