More efficient serialization.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3767 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: StreamableIntIntMap.java,v 1.2 2004/08/27 02:20:36 mdb Exp $
|
// $Id$
|
||||||
//
|
//
|
||||||
// Narya library - tools for developing networked games
|
// Narya library - tools for developing networked games
|
||||||
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
|
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
|
||||||
@@ -65,11 +65,10 @@ public class StreamableIntIntMap extends IntIntMap
|
|||||||
{
|
{
|
||||||
int ecount = size();
|
int ecount = size();
|
||||||
out.writeInt(ecount);
|
out.writeInt(ecount);
|
||||||
Iterator iter = keys();
|
for (Iterator itr = entrySet().iterator(); itr.hasNext(); ) {
|
||||||
while (iter.hasNext()) {
|
Entry entry = (Entry) itr.next();
|
||||||
int key = ((Integer)iter.next()).intValue();
|
out.writeInt(entry.getIntKey());
|
||||||
out.writeInt(key);
|
out.writeInt(entry.getIntValue());
|
||||||
out.writeInt(get(key));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user