From aeffbb31d704185fb8a451b2cdb71e4b86e95a9d Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Wed, 23 Apr 2008 08:35:59 -0700 Subject: [PATCH] kill dead code --- src/common/buffer.cc | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 4c5efe725..7ef22e801 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -349,29 +349,8 @@ Buffer::AddAtStart (uint32_t start) 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 @@ Buffer::AddAtEnd (uint32_t end) 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;