directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1536687 - /directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/TLV.java
Date Tue, 29 Oct 2013 12:36:09 GMT
Author: elecharny
Date: Tue Oct 29 12:36:09 2013
New Revision: 1536687

URL: http://svn.apache.org/r1536687
Log:
Fixed the ONE_BYTE array size : there is no reason to set it to 256, when it can only contain
128 values.

Modified:
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/TLV.java

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/TLV.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/TLV.java?rev=1536687&r1=1536686&r2=1536687&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/TLV.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/TLV.java
Tue Oct 29 12:36:09 2013
@@ -83,12 +83,12 @@ public class TLV
     public static final int LENGTH_SHORT_MASK = 0x007F;
 
     /** A speedup for single bytes length */
-    private static final byte[][] ONE_BYTE = new byte[256][];
+    private static final byte[][] ONE_BYTE = new byte[128][];
 
     // Initialize an array of byte[] used for encoding lengths below 128
     static
     {
-        for ( int i = 0; i < 256; i++ )
+        for ( int i = 0; i < 128; i++ )
         {
             ONE_BYTE[i] = new byte[1];
             ONE_BYTE[i][0] = ( byte ) i;



Mime
View raw message