From 6bd286d924835b7c27844031a85bc315bc6ef2f3 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 9 Mar 2017 00:44:21 +0100 Subject: [PATCH] Fix unnecessary resizing in ViewData --- components/terrain/viewdata.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/terrain/viewdata.cpp b/components/terrain/viewdata.cpp index ce89150c1..71768bd7c 100644 --- a/components/terrain/viewdata.cpp +++ b/components/terrain/viewdata.cpp @@ -14,9 +14,10 @@ ViewData::ViewData() void ViewData::add(QuadTreeNode *node, bool visible) { - int index = mNumEntries++; + unsigned int index = mNumEntries++; - mEntries.resize(index+1); + if (index+1 > mEntries.size()) + mEntries.resize(index+1); Entry& entry = mEntries[index]; if (entry.set(node, visible))