diff --git a/src/java/com/threerings/crowd/chat/server/ChatChannelManager.java b/src/java/com/threerings/crowd/chat/server/ChatChannelManager.java index 149951db6..111b297db 100644 --- a/src/java/com/threerings/crowd/chat/server/ChatChannelManager.java +++ b/src/java/com/threerings/crowd/chat/server/ChatChannelManager.java @@ -25,7 +25,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import com.google.common.base.Function; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.inject.Inject; @@ -232,19 +231,16 @@ public abstract class ChatChannelManager // generate a mapping from node name to an array of body ids for the participants that are // currently on the node in question final Map partMap = Maps.newHashMap(); - _peerMan.applyToNodes(new Function() { - public Void apply (NodeObject nodeobj) { - ArrayIntSet nodeBodyIds = new ArrayIntSet(); - for (ClientInfo clinfo : nodeobj.clients) { - int bodyId = getBodyId(((CrowdClientInfo)clinfo).visibleName); - if (info.participants.contains(bodyId)) { - nodeBodyIds.add(bodyId); - } + for (NodeObject nodeobj : _peerMan.getNodeObjects()) { + ArrayIntSet nodeBodyIds = new ArrayIntSet(); + for (ClientInfo clinfo : nodeobj.clients) { + int bodyId = getBodyId(((CrowdClientInfo)clinfo).visibleName); + if (info.participants.contains(bodyId)) { + nodeBodyIds.add(bodyId); } - partMap.put(nodeobj.nodeName, nodeBodyIds.toIntArray()); - return null; } - }); + partMap.put(nodeobj.nodeName, nodeBodyIds.toIntArray()); + } for (Map.Entry entry : partMap.entrySet()) { _peerMan.invokeNodeAction( diff --git a/src/java/com/threerings/presents/peer/server/EHCachePeerCoordinator.java b/src/java/com/threerings/presents/peer/server/EHCachePeerCoordinator.java index 4148f970f..1d1cce23d 100644 --- a/src/java/com/threerings/presents/peer/server/EHCachePeerCoordinator.java +++ b/src/java/com/threerings/presents/peer/server/EHCachePeerCoordinator.java @@ -114,15 +114,12 @@ public class EHCachePeerCoordinator extends CacheManagerPeerProviderFactory // list the current whirled peers final List result = Lists.newArrayList(); final Set nodes = Sets.newHashSet(); - _peerMan.applyToNodes(new Function() { - public Void apply (NodeObject node) { - if (node != _peerMan.getNodeObject()) { - addCachesForNode(result, node.nodeName); - nodes.add(node.nodeName); - } - return null; + for (NodeObject node : _peerMan.getNodeObjects()) { + if (node != _peerMan.getNodeObject()) { + addCachesForNode(result, node.nodeName); + nodes.add(node.nodeName); } - }); + } // if any previously known peer is no longer with us, clear out the cache Set> toRemove = Sets.newHashSet(); diff --git a/src/java/com/threerings/presents/peer/server/PeerManager.java b/src/java/com/threerings/presents/peer/server/PeerManager.java index dfde183d7..fc2b1f030 100644 --- a/src/java/com/threerings/presents/peer/server/PeerManager.java +++ b/src/java/com/threerings/presents/peer/server/PeerManager.java @@ -323,16 +323,6 @@ public abstract class PeerManager return null; } - /** - * Applies the supplied function to all {@link NodeObject}s. The operation should not modify - * the objects unless you really know what you're doing. More likely it will summarize - * information contained therein. - */ - public Iterable applyToNodes (Function op) - { - return Iterables.transform(getNodeObjects(), op); - } - /** * Invokes the supplied function on all node objects (except the local node). A caller * that needs to call an invocation service method on a remote node should use this mechanism