From 428a4cdd716bef4104b5d0934848944e4bb8d441 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 15 May 2017 19:41:08 +0200 Subject: [PATCH] SpatialSort: use std::vector::clear(). --- code/SGSpatialSort.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/code/SGSpatialSort.cpp b/code/SGSpatialSort.cpp index fe8bc3f..7a80381 100644 --- a/code/SGSpatialSort.cpp +++ b/code/SGSpatialSort.cpp @@ -48,7 +48,6 @@ the 3ds loader handling smooth groups correctly */ using namespace Assimp; - // ------------------------------------------------------------------------------------------------ SGSpatialSort::SGSpatialSort() { @@ -89,12 +88,11 @@ void SGSpatialSort::FindPositions( const aiVector3D& pPosition, float dist = pPosition * mPlaneNormal; float minDist = dist - pRadius, maxDist = dist + pRadius; - // clear the array in this strange fashion because a simple clear() would also deallocate - // the array which we want to avoid - poResults.erase( poResults.begin(), poResults.end()); + // clear the array + poResults.clear(); // quick check for positions outside the range - if( mPositions.size() == 0) + if( mPositions.empty() ) return; if( maxDist < mPositions.front().mDistance) return; -- 2.7.4