You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/05/20 06:32:24 UTC

[GitHub] [ignite-3] rpuch commented on a diff in pull request #814: IGNITE-16933 PageMemory-based MV storage implementation

rpuch commented on code in PR #814:
URL: https://github.com/apache/ignite-3/pull/814#discussion_r877780991


##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/io/AbstractDataPageIo.java:
##########
@@ -611,24 +626,73 @@ protected int getDataOffset(long pageAddr, int itemId, int pageSize) {
 
         assert directCnt > 0 : "itemId=" + itemId + ", directCnt=" + directCnt + ", page=" + printPageLayout(pageAddr, pageSize);
 
+        final int directItemId;

Review Comment:
   It makes sense to declare this variable `final` because the code that follows it is pretty long (longer than 3-5 lines). It makes the code more easily comprehensible (the reader easily sees that the variable never gets reassigned). This allows to understand the code more quickly (and spare time).
   
   In the original code, for example, `itemId` was reassigned, and you had to read really carefully (=slowly) to spot it.



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org