You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/05/12 04:15:52 UTC

[GitHub] [rocketmq] XiaoyiPeng commented on a diff in pull request #4281: [ISSUE #4280] Polish the method 'indexKeyHashMethod' in class 'IndexFile'.

XiaoyiPeng commented on code in PR #4281:
URL: https://github.com/apache/rocketmq/pull/4281#discussion_r870931759


##########
store/src/main/java/org/apache/rocketmq/store/index/IndexFile.java:
##########
@@ -145,12 +145,9 @@ public boolean putKey(final String key, final long phyOffset, final long storeTi
         return false;
     }
 
-    public int indexKeyHashMethod(final String key) {
+    private int indexKeyHashMethod(final String key) {
         int keyHash = key.hashCode();
-        int keyHashPositive = Math.abs(keyHash);

Review Comment:
   Oh, you remind me, this case can lead to serious problem.



-- 
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: dev-unsubscribe@rocketmq.apache.org

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