diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index 9a007f037..004ae17fd 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -2008,10 +2008,10 @@ bool Optimizer::MergeGeometryVisitor::mergeGeode(osg::Geode& geode) unsigned int numVertices(duplicateList.front()->getVertexArray() ? duplicateList.front()->getVertexArray()->getNumElements() : 0); DuplicateList::iterator eachGeom(duplicateList.begin()+1); // until all geometries have been checked or _targetMaximumNumberOfVertices is reached - for (;eachGeom!=duplicateList.end(); ++eachGeom) + for(;eachGeom!=duplicateList.end(); ++eachGeom) { unsigned int numAddVertices((*eachGeom)->getVertexArray() ? (*eachGeom)->getVertexArray()->getNumElements() : 0); - if (numVertices+numAddVertices<_targetMaximumNumberOfVertices) + if ((numVertices+numAddVertices)>_targetMaximumNumberOfVertices) { break; }