Add a shortcut return in case reallocate has nothing to do. Should reduce a lot of memory thrashing on irrArrays.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4218 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2012-06-27 17:16:19 +00:00
parent d4ee640740
commit 8106d4200f
1 changed files with 3 additions and 0 deletions

View File

@ -62,6 +62,9 @@ public:
/** \param new_size New size of array. */
void reallocate(u32 new_size)
{
if (allocated==new_size)
return;
T* old_data = data;
data = allocator.allocate(new_size); //new T[new_size];