HashMap.java (putAll): Use Iterator hasNext() method.

2003-11-26  Stuart Ballard <stuart.ballard@corp.fast.net>

	* java/util/HashMap.java (putAll): Use Iterator hasNext() method.
	(putAllInternal): Likewise.
	* java/util/Hashtable.java (putAll): Use Iterator hasNext() method.
	(putAllInternal): Likewise.

From-SVN: r73964
This commit is contained in:
Stuart Ballard 2003-11-26 21:45:55 +00:00 committed by Michael Koch
parent cb5599c77a
commit 32ffbe9280
3 changed files with 15 additions and 9 deletions

View File

@ -1,3 +1,10 @@
2003-11-26 Stuart Ballard <stuart.ballard@corp.fast.net>
* java/util/HashMap.java (putAll): Use Iterator hasNext() method.
(putAllInternal): Likewise.
* java/util/Hashtable.java (putAll): Use Iterator hasNext() method.
(putAllInternal): Likewise.
2003-11-26 Michael Koch <konqueror@gmx.de>
* java/net/URLStreamHandler.java

View File

@ -381,8 +381,7 @@ public class HashMap extends AbstractMap
public void putAll(Map m)
{
Iterator itr = m.entrySet().iterator();
int msize = m.size();
while (msize-- > 0)
while (itr.hasNext())
{
Map.Entry e = (Map.Entry) itr.next();
// Optimize in case the Entry is one of our own.
@ -709,10 +708,10 @@ public class HashMap extends AbstractMap
void putAllInternal(Map m)
{
Iterator itr = m.entrySet().iterator();
int msize = m.size();
size = msize;
while (msize-- > 0)
size = 0;
while (itr.hasNext())
{
size++;
Map.Entry e = (Map.Entry) itr.next();
Object key = e.getKey();
int idx = hash(key);

View File

@ -510,7 +510,7 @@ public class Hashtable extends Dictionary
{
Iterator itr = m.entrySet().iterator();
for (int msize = m.size(); msize > 0; msize--)
while (itr.hasNext())
{
Map.Entry e = (Map.Entry) itr.next();
// Optimize in case the Entry is one of our own.
@ -859,11 +859,11 @@ public class Hashtable extends Dictionary
void putAllInternal(Map m)
{
Iterator itr = m.entrySet().iterator();
int msize = m.size();
this.size = msize;
size = 0;
for (; msize > 0; msize--)
while (itr.hasNext())
{
size++;
Map.Entry e = (Map.Entry) itr.next();
Object key = e.getKey();
int idx = hash(key);