--- a/src/common/buffer.cc Tue Apr 22 14:36:24 2008 -0700
+++ b/src/common/buffer.cc Wed Apr 23 08:35:59 2008 -0700
@@ -349,29 +349,8 @@
m_start -= start;
HEURISTICS (g_nAddNoRealloc++);
}
-#if 0
- // the following is an optimization
- else if (m_start >= start)
- {
- struct BufferData *newData = Buffer::Create (m_data->m_size);
- memcpy (newData->m_data + m_start, m_data->m_data + m_start, GetInternalSize ());
- m_data->m_count--;
- if (m_data->m_count == 0)
- {
- Buffer::Recycle (m_data);
- }
- m_data = newData;
-
- m_start -= start;
- HEURISTICS (g_nAddRealloc++);
- }
else
{
- NS_ASSERT (m_start < start);
-#else
- else
- {
-#endif
uint32_t newSize = GetInternalSize () + start;
struct BufferData *newData = Buffer::Create (newSize);
memcpy (newData->m_data + start, m_data->m_data + m_start, GetInternalSize ());
@@ -414,23 +393,6 @@
HEURISTICS (g_nAddNoRealloc++);
}
-#if 0
- // this is an optimization
- else if (GetInternalEnd () + end > m_data->m_size)
- {
- struct BufferData *newData = Buffer::Create (newSize);
- memcpy (newData->m_data + m_start, m_data->m_data + m_start, GetInternalSize ());
- m_data->m_count--;
- if (m_data->m_count == 0)
- {
- Buffer::Recycle (m_data);
- }
- m_data = newData;
-
- m_end += end;
- HEURISTICS (g_nAddRealloc++);
- }
-#endif
else
{
uint32_t newSize = GetInternalSize () + end;