commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcucchi...@apache.org
Subject svn commit: r1188750 - /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/IntHashMap.java
Date Tue, 25 Oct 2011 16:00:59 GMT
Author: mcucchiara
Date: Tue Oct 25 16:00:58 2011
New Revision: 1188750

URL: http://svn.apache.org/viewvc?rev=1188750&view=rev
Log:
Mask is a magic number

Modified:
    commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/IntHashMap.java

Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/IntHashMap.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/IntHashMap.java?rev=1188750&r1=1188749&r2=1188750&view=diff
==============================================================================
--- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/IntHashMap.java (original)
+++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/IntHashMap.java Tue Oct
25 16:00:58 2011
@@ -253,7 +253,7 @@ public class IntHashMap<K extends Number
      */
     public final boolean containsKey( int key )
     {
-        int index = ( key & 0x7FFFFFFF ) % table.length;
+        int index = ( key & MASK ) % table.length;
 
         for ( Entry e = table[index]; e != null; e = e.getNext() )
         {
@@ -267,7 +267,7 @@ public class IntHashMap<K extends Number
 
     public final V get( int key )
     {
-        int index = ( key & 0x7FFFFFFF ) % table.length;
+        int index = ( key & MASK ) % table.length;
 
         for ( Entry e = table[index]; e != null; e = e.getNext() )
         {
@@ -281,7 +281,7 @@ public class IntHashMap<K extends Number
 
     public final V put( int key, V value )
     {
-        int index = ( key & 0x7FFFFFFF ) % table.length;
+        int index = ( key & MASK ) % table.length;
 
         if ( value == null )
         {
@@ -315,7 +315,7 @@ public class IntHashMap<K extends Number
 
     public final V remove( int key )
     {
-        int index = ( key & 0x7FFFFFFF ) % table.length;
+        int index = ( key & MASK ) % table.length;
 
         for ( Entry e = table[index], prev = null; e != null; prev = e, e = e.getNext() )
         {



Mime
View raw message