You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by da...@apache.org on 2012/09/28 06:45:35 UTC

svn commit: r1391299 - /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/mylzw/MyLzwCompressor.java

Author: damjan
Date: Fri Sep 28 04:45:35 2012
New Revision: 1391299

URL: http://svn.apache.org/viewvc?rev=1391299&view=rev
Log:
LZW table clearing is handled in addTableEntry(), so remove
the redundant cleared variable.


Modified:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/mylzw/MyLzwCompressor.java

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/mylzw/MyLzwCompressor.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/mylzw/MyLzwCompressor.java?rev=1391299&r1=1391298&r2=1391299&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/mylzw/MyLzwCompressor.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/mylzw/MyLzwCompressor.java Fri Sep 28 04:45:35 2012
@@ -22,9 +22,6 @@ import java.util.HashMap;
 import java.util.Map;
 
 public class MyLzwCompressor {
-
-    // private static final int MAX_TABLE_SIZE = 1 << 12;
-
     private int codeSize;
     private final int initialCodeSize;
     private int codes = -1;
@@ -236,7 +233,6 @@ public class MyLzwCompressor {
         InitializeStringTable();
         clearTable();
         writeClearCode(bos);
-        boolean cleared = false;
 
         int w_start = 0;
         int w_length = 0;
@@ -244,17 +240,15 @@ public class MyLzwCompressor {
         for (int i = 0; i < bytes.length; i++) {
             if (isInTable(bytes, w_start, w_length + 1)) {
                 w_length++;
-
-                cleared = false;
             } else {
                 int code = codeFromString(bytes, w_start, w_length);
                 writeDataCode(bos, code);
-                cleared = addTableEntry(bos, bytes, w_start, w_length + 1);
+                addTableEntry(bos, bytes, w_start, w_length + 1);
 
                 w_start = i;
                 w_length = 1;
             }
-        } /* end of for loop */
+        }
 
         int code = codeFromString(bytes, w_start, w_length);
         writeDataCode(bos, code);