commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [commons-compress] euske commented on a change in pull request #82: Made some variable names more consistent with the other parts.
Date Mon, 28 Oct 2019 22:16:07 GMT
euske commented on a change in pull request #82: Made some variable names more consistent with
the other parts.
URL: https://github.com/apache/commons-compress/pull/82#discussion_r339817817
 
 

 ##########
 File path: src/main/java/org/apache/commons/compress/compressors/z/ZCompressorInputStream.java
 ##########
 @@ -103,12 +103,12 @@ private void reAlignReading() throws IOException {
     @Override
     protected int addEntry(final int previousCode, final byte character) throws IOException
{
         final int maxTableSize = 1 << getCodeSize();
-        final int r = addEntry(previousCode, character, maxTableSize);
+        final int idx = addEntry(previousCode, character, maxTableSize);
         if (getTableSize() == maxTableSize && getCodeSize() < maxCodeSize) {
             reAlignReading();
             incrementCodeSize();
         }
-        return r;
+        return idx;
 
 Review comment:
   This suggestion for "idx" comes from a similar expression in UnshrinkingInputStream.java:
   
       60:        final int idx = addEntry(previousCode, character, MAX_TABLE_SIZE);
       61:        if (idx >= 0) {
       62:            isUsed[idx] = true;
       63:        }
       64:        return idx;
    
   The use of "idx" is slightly more common than "index" throughout the project. In this case,
there's already a variable that has a similar use, so the system picked it up. Our system
doesn't create a new name but it tries to choose the best looking candidate to make the code
consistent with a minimal amount of change.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message