Commit 8106d420 authored by hybrid's avatar hybrid

Add a shortcut return in case reallocate has nothing to do. Should reduce a...

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
parent d4ee6407
......@@ -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];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment