From 2f66e56e46eb3f900f2b9385259e6b319b7c2821 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 6 Nov 2014 15:23:30 -0800 Subject: [PATCH] update Stats to new tbb node iteration --- interface/src/ui/Stats.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/interface/src/ui/Stats.cpp b/interface/src/ui/Stats.cpp index 8e4b900180..08eaac9334 100644 --- a/interface/src/ui/Stats.cpp +++ b/interface/src/ui/Stats.cpp @@ -329,10 +329,7 @@ void Stats::display( unsigned long totalPingVoxel = 0; int voxelServerCount = 0; - NodeHashSnapshot snapshotHash = nodeList->getNodeHash().snapshot_table(); - - for (auto it = snapshotHash.begin(); it != snapshotHash.end(); it++) { - SharedNodePointer node = it->second; + nodeList->eachNode([&totalPingVoxel, &pingVoxelMax, &voxelServerCount](const SharedNodePointer& node){ // TODO: this should also support entities if (node->getType() == NodeType::VoxelServer) { totalPingVoxel += node->getPingMs(); @@ -341,7 +338,7 @@ void Stats::display( pingVoxelMax = node->getPingMs(); } } - } + }); if (voxelServerCount) { pingVoxel = totalPingVoxel/voxelServerCount;