Просмотр исходного кода

SpatialSort: use std::vector::resize( 0 ) to improve readability.

Kim Kulling 8 лет назад
Родитель
Сommit
186629b372
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      code/SpatialSort.cpp

+ 1 - 1
code/SpatialSort.cpp

@@ -269,7 +269,7 @@ void SpatialSort::FindIdenticalPositions( const aiVector3D& pPosition,
 
 
     // clear the array in this strange fashion because a simple clear() would also deallocate
     // clear the array in this strange fashion because a simple clear() would also deallocate
     // the array which we want to avoid
     // the array which we want to avoid
-    poResults.erase( poResults.begin(), poResults.end());
+    poResults.resize( 0 );
 
 
     // do a binary search for the minimal distance to start the iteration there
     // do a binary search for the minimal distance to start the iteration there
     unsigned int index = (unsigned int)mPositions.size() / 2;
     unsigned int index = (unsigned int)mPositions.size() / 2;