guiyanakuang commented on a change in pull request #739:
URL: https://github.com/apache/orc/pull/739#discussion_r686775537
##########
File path: java/core/src/java/org/apache/orc/impl/RecordReaderUtils.java
##########
@@ -504,38 +504,33 @@ static void readDiskRanges(FSDataInputStream file,
private static final class Key implements Comparable<Key> {
private final int capacity;
private final long insertionGeneration;
+ private final int hash;
Key(int capacity, long insertionGeneration) {
this.capacity = capacity;
this.insertionGeneration = insertionGeneration;
+ this.hash = new
HashCodeBuilder().append(capacity).append(insertionGeneration)
Review comment:
I found that the equals and hashCode methods of the Key are not used at
all, because the TreeMap implementation logic only use of compareTo. It is
redundant to put the hashCode calculation statement in the constructor, and in
fact there is no need to override them.
--
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]