forked from Mirrorlandia_minetest/irrlicht
Avoid some warnings from static code analysis.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6296 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
684293f527
commit
8c0ee7d9ab
@ -299,22 +299,27 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
strategy = other.strategy;
|
strategy = other.strategy;
|
||||||
|
|
||||||
|
// (TODO: we could probably avoid re-allocations of data when (allocated < other.allocated)
|
||||||
|
|
||||||
if (data)
|
if (data)
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
//if (allocated < other.allocated)
|
|
||||||
if (other.allocated == 0)
|
|
||||||
data = 0;
|
|
||||||
else
|
|
||||||
data = allocator.allocate(other.allocated); // new T[other.allocated];
|
|
||||||
|
|
||||||
used = other.used;
|
used = other.used;
|
||||||
free_when_destroyed = true;
|
free_when_destroyed = true;
|
||||||
is_sorted = other.is_sorted;
|
is_sorted = other.is_sorted;
|
||||||
allocated = other.allocated;
|
allocated = other.allocated;
|
||||||
|
|
||||||
for (u32 i=0; i<other.used; ++i)
|
if (other.allocated == 0)
|
||||||
allocator.construct(&data[i], other.data[i]); // data[i] = other.data[i];
|
{
|
||||||
|
data = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
data = allocator.allocate(other.allocated); // new T[other.allocated];
|
||||||
|
|
||||||
|
for (u32 i=0; i<other.used; ++i)
|
||||||
|
allocator.construct(&data[i], other.data[i]); // data[i] = other.data[i];
|
||||||
|
}
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user