No need to do hash lookups in writeObject().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2617 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
//
|
//
|
||||||
// $Id: StreamableHashMap.java,v 1.1 2003/05/27 22:48:31 mdb Exp $
|
// $Id: StreamableHashMap.java,v 1.2 2003/05/27 22:54:36 ray Exp $
|
||||||
|
|
||||||
package com.threerings.util;
|
package com.threerings.util;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import com.threerings.io.ObjectInputStream;
|
import com.threerings.io.ObjectInputStream;
|
||||||
@@ -45,10 +46,10 @@ public class StreamableHashMap extends HashMap
|
|||||||
{
|
{
|
||||||
int ecount = size();
|
int ecount = size();
|
||||||
out.writeInt(ecount);
|
out.writeInt(ecount);
|
||||||
for (Iterator iter = keySet().iterator(); iter.hasNext(); ) {
|
for (Iterator iter = entrySet().iterator(); iter.hasNext(); ) {
|
||||||
Object key = iter.next();
|
Map.Entry entry = (Map.Entry) iter.next();
|
||||||
out.writeObject(key);
|
out.writeObject(entry.getKey());
|
||||||
out.writeObject(get(key));
|
out.writeObject(entry.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user