Reported by f.haeglsperger@gmx.de [classpath patch #2485]
2004-05-05 Mark Wielaard <mark@klomp.org> Reported by f.haeglsperger@gmx.de [classpath patch #2485] * java/util/HashMap.java (rehash): Add entry at start of bucket. From-SVN: r81512
This commit is contained in:
parent
a54f498a27
commit
b1210ca233
2 changed files with 7 additions and 11 deletions
|
@ -743,18 +743,9 @@ public class HashMap extends AbstractMap
|
|||
{
|
||||
int idx = hash(e.key);
|
||||
HashEntry dest = buckets[idx];
|
||||
|
||||
if (dest != null)
|
||||
{
|
||||
while (dest.next != null)
|
||||
dest = dest.next;
|
||||
dest.next = e;
|
||||
}
|
||||
else
|
||||
buckets[idx] = e;
|
||||
|
||||
HashEntry next = e.next;
|
||||
e.next = null;
|
||||
e.next = buckets[idx];
|
||||
buckets[idx] = e;
|
||||
e = next;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue