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-e03cc46cb475master
parent
d4ee640740
commit
8106d4200f
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue