From: frohlich Date: Sun, 1 Mar 2009 21:25:14 +0000 (+0000) Subject: Don't waste space with too huge stl containers. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=afed842ad19ff4196f4987f3e35746d872f67dd0;p=simgear.git Don't waste space with too huge stl containers. Modified Files: simgear/scene/bvh/BVHStaticData.hxx --- diff --git a/simgear/scene/bvh/BVHStaticData.hxx b/simgear/scene/bvh/BVHStaticData.hxx index 27bacef2..400632ad 100644 --- a/simgear/scene/bvh/BVHStaticData.hxx +++ b/simgear/scene/bvh/BVHStaticData.hxx @@ -44,6 +44,12 @@ public: { _materials.push_back(material); return _materials.size() - 1; } const SGMaterial* getMaterial(unsigned i) const { if (_materials.size() <= i) return 0; return _materials[i]; } + + void trim() + { + std::vector(_vertices).swap(_vertices); + std::vector(_materials).swap(_materials); + } private: std::vector _vertices;