From 4fefd87b80b4fa367caad952c94d0051e5b84ab2 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 30 Jun 2014 10:13:22 +0000 Subject: [PATCH] From Mikhail Izmestev, "Attached fix to avoid vector reallocs on push_back in StateGraph::moveStateGraph." git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14335 16af8721-9629-0410-8352-f15c8da7e697 --- include/osgUtil/StateGraph | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/osgUtil/StateGraph b/include/osgUtil/StateGraph index da070c8de..cc78face4 100644 --- a/include/osgUtil/StateGraph +++ b/include/osgUtil/StateGraph @@ -207,6 +207,7 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced // use return path to trace back steps to sg_new. std::vector return_path; + return_path.reserve(sg_new->_depth+1); // need to pop back root render graph. do @@ -248,6 +249,7 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced // use return path to trace back steps to sg_new. std::vector return_path; + return_path.reserve(sg_new->_depth+1); // need to pop back up to the same depth as the curr state group. while (sg_new->_depth>sg_curr->_depth)