Merge changes from the witness.

This commit is contained in:
castano
2010-07-13 03:08:45 +00:00
parent 30b9545d75
commit 9094756997
23 changed files with 487 additions and 478 deletions

View File

@ -275,12 +275,14 @@ namespace nv
}
/// Remove the first instance of the given element.
void remove(const T & element)
bool remove(const T & element)
{
for (uint i = 0; i < m_size; i++) {
removeAt(i);
break;
uint index;
if (find(element, &index)) {
removeAt(index);
return true;
}
return false;
}
/// Insert the given element at the given index shifting all the elements up.
@ -342,7 +344,7 @@ namespace nv
}
if( m_size == 0 ) {
//Allocate(0); // Don't shrink automatically.
//allocate(0); // Don't shrink automatically.
}
else if( m_size <= m_buffer_size/* && m_size > m_buffer_size >> 1*/) {
// don't compact yet.
@ -382,7 +384,7 @@ namespace nv
}
if( m_size == 0 ) {
//Allocate(0); // Don't shrink automatically.
//allocate(0); // Don't shrink automatically.
}
else if( m_size <= m_buffer_size && m_size > m_buffer_size >> 1 ) {
// don't compact yet.