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:
@@ -332,7 +332,7 @@ public class IntIntMap
|
|||||||
if (!(o instanceof Integer)) {
|
if (!(o instanceof Integer)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return remove((Integer)o);
|
return remove(((Integer)o).intValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean remove (int value) {
|
public boolean remove (int value) {
|
||||||
@@ -388,8 +388,7 @@ public class IntIntMap
|
|||||||
int[] ret = new int[_size];
|
int[] ret = new int[_size];
|
||||||
|
|
||||||
int dex = 0;
|
int dex = 0;
|
||||||
for (int ii=0, nn=_buckets.length; ii < nn; ii++) {
|
for (Record r : _buckets) {
|
||||||
Record r = _buckets[ii];
|
|
||||||
while (r != null) {
|
while (r != null) {
|
||||||
ret[dex++] = keys ? r.key : r.value;
|
ret[dex++] = keys ? r.key : r.value;
|
||||||
r = r.next;
|
r = r.next;
|
||||||
|
|||||||
Reference in New Issue
Block a user