Patch from Dave to avoid potential disaster when Java decides remove(Integer)

should mean a call to remove(Object) instead of unboxing the integer and
calling remove(int). Beware bogus boxing.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2585 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
samskivert
2009-07-10 23:40:11 +00:00
parent 8296003607
commit 96f48149a2
+2 -3
View File
@@ -332,7 +332,7 @@ public class IntIntMap
if (!(o instanceof Integer)) {
return false;
}
return remove((Integer)o);
return remove(((Integer)o).intValue());
}
public boolean remove (int value) {
@@ -388,8 +388,7 @@ public class IntIntMap
int[] ret = new int[_size];
int dex = 0;
for (int ii=0, nn=_buckets.length; ii < nn; ii++) {
Record r = _buckets[ii];
for (Record r : _buckets) {
while (r != null) {
ret[dex++] = keys ? r.key : r.value;
r = r.next;