You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2010/08/14 18:02:52 UTC

svn commit: r985518 - /xerces/java/trunk/src/org/apache/xerces/util/SymbolTable.java

Author: mrglavas
Date: Sat Aug 14 16:02:52 2010
New Revision: 985518

URL: http://svn.apache.org/viewvc?rev=985518&view=rev
Log:
Fixing JIRA Issue #1464: http://issues.apache.org/jira/browse/XERCESJ-1464. Use 31 bits in computing the hash instead of 27. Should improve the distribution symbols in a very large table. Thanks to Roland Illig for spotting this issue.

Modified:
    xerces/java/trunk/src/org/apache/xerces/util/SymbolTable.java

Modified: xerces/java/trunk/src/org/apache/xerces/util/SymbolTable.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/util/SymbolTable.java?rev=985518&r1=985517&r2=985518&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/util/SymbolTable.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/util/SymbolTable.java Sat Aug 14 16:02:52 2010
@@ -243,7 +243,7 @@ public class SymbolTable {
      * @param symbol The symbol to hash.
      */
     public int hash(String symbol) {
-        return symbol.hashCode() & 0x7FFFFFF;
+        return symbol.hashCode() & 0x7FFFFFFF;
     } // hash(String):int
 
     /**
@@ -263,7 +263,7 @@ public class SymbolTable {
         for (int i = 0; i < length; ++i) {
             code = code * 31 + buffer[offset + i];
         }
-        return code & 0x7FFFFFF;
+        return code & 0x7FFFFFFF;
 
     } // hash(char[],int,int):int
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org