don't check twice, thanks Marten Svanfeldt

>>2. reserve(int) method check capacity() < _Count twice.
This commit is contained in:
ejcoumans
2007-06-19 23:45:10 +00:00
parent 769809e3a7
commit c095927afb

View File

@@ -216,21 +216,18 @@ class btAlignedObjectArray
{ // determine new minimum length of allocated storage { // determine new minimum length of allocated storage
if (capacity() < _Count) if (capacity() < _Count)
{ // not enough room, reallocate { // not enough room, reallocate
if (capacity() < _Count) T* s = (T*)allocate(_Count);
{
T* s = (T*)allocate(_Count);
copy(0, size(), s); copy(0, size(), s);
destroy(0,size()); destroy(0,size());
deallocate(); deallocate();
m_data = s; m_data = s;
m_capacity = _Count; m_capacity = _Count;
}
} }
} }