From e2b8ac9d4284fcd92f53d5e6a5b06e4fe5c5f44b Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Mon, 24 Aug 2009 02:55:56 +0000 Subject: [PATCH] New, more efficient Maps. Don't these deck chairs look GREAT? git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@871 c613c5cb-e716-0410-b11b-feb51c14d237 --- src/as/com/threerings/parlor/client/ParlorDirector.as | 5 +++-- src/as/com/threerings/whirled/client/SceneDirector.as | 5 +++-- src/as/com/threerings/whirled/spot/data/SpotSceneImpl.as | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/as/com/threerings/parlor/client/ParlorDirector.as b/src/as/com/threerings/parlor/client/ParlorDirector.as index da6addcb..84d52f4c 100644 --- a/src/as/com/threerings/parlor/client/ParlorDirector.as +++ b/src/as/com/threerings/parlor/client/ParlorDirector.as @@ -22,7 +22,8 @@ package com.threerings.parlor.client { import com.threerings.util.ArrayUtil; -import com.threerings.util.HashMap; +import com.threerings.util.Map; +import com.threerings.util.Maps; import com.threerings.util.Log; import com.threerings.util.Name; @@ -236,7 +237,7 @@ public class ParlorDirector extends BasicDirector /** A table of acknowledged (but not yet accepted or refused) invitation requests, keyed on * invitation id. */ - protected var _pendingInvites :HashMap = new HashMap(); + protected var _pendingInvites :Map = Maps.newMapOf(int); /** We notify the entities on this list when we get a game ready notification. */ protected var _grobs :Array = new Array(); diff --git a/src/as/com/threerings/whirled/client/SceneDirector.as b/src/as/com/threerings/whirled/client/SceneDirector.as index 5bbcf991..7e50f3cd 100644 --- a/src/as/com/threerings/whirled/client/SceneDirector.as +++ b/src/as/com/threerings/whirled/client/SceneDirector.as @@ -25,7 +25,8 @@ import flash.errors.IOError; import flash.errors.IllegalOperationError; import com.threerings.util.Log; -import com.threerings.util.LRUHashMap; +import com.threerings.util.Map; +import com.threerings.util.Maps; import com.threerings.util.ResultListener; import com.threerings.io.TypedArray; @@ -558,7 +559,7 @@ public class SceneDirector extends BasicDirector protected var _fact :SceneFactory; /** A cache of scene model information. */ - protected var _scache :LRUHashMap = new LRUHashMap(5); + protected var _scache :Map = Maps.newLRIMap(5, Maps.newMapOf(int)); /** The display scene object for the scene we currently occupy. */ protected var _scene :Scene; diff --git a/src/as/com/threerings/whirled/spot/data/SpotSceneImpl.as b/src/as/com/threerings/whirled/spot/data/SpotSceneImpl.as index 9eb3427e..0f03c7b0 100644 --- a/src/as/com/threerings/whirled/spot/data/SpotSceneImpl.as +++ b/src/as/com/threerings/whirled/spot/data/SpotSceneImpl.as @@ -23,7 +23,8 @@ package com.threerings.whirled.spot.data { import com.threerings.util.ArrayIterator; import com.threerings.util.Iterator; -import com.threerings.util.HashMap; +import com.threerings.util.Map; +import com.threerings.util.Maps; import com.threerings.util.Log; /** @@ -147,7 +148,7 @@ public class SpotSceneImpl protected var _smodel :SpotSceneModel; /** A mapping from portal id to portal. */ - protected var _portals :HashMap = new HashMap(); + protected var _portals :Map = Maps.newMapOf(int); /** We don't allow more than ~32k portals in a scene. Things would * slow down *way* before we got there. */