From fd74ac76167ac699fc1011c6e7a2d75b2fa48c84 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Wed, 5 Aug 2015 15:20:10 -0400 Subject: [PATCH] remove un-needed return value --- src/network/model/buffer.cc | 19 ++----------------- src/network/model/buffer.h | 6 ++---- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/src/network/model/buffer.cc b/src/network/model/buffer.cc index 6f4c8d37f..3c014976f 100644 --- a/src/network/model/buffer.cc +++ b/src/network/model/buffer.cc @@ -305,11 +305,10 @@ Buffer::GetInternalEnd (void) const return m_end - (m_zeroAreaEnd - m_zeroAreaStart); } -bool +void Buffer::AddAtStart (uint32_t start) { NS_LOG_FUNCTION (this << start); - bool dirty; NS_ASSERT (CheckInternalState ()); bool isDirty = m_data->m_count > 1 && m_start > m_data->m_dirtyStart; if (m_start >= start && !isDirty) @@ -321,7 +320,6 @@ Buffer::AddAtStart (uint32_t start) */ NS_ASSERT (m_data->m_count == 1 || m_start == m_data->m_dirtyStart); m_start -= start; - dirty = m_start > m_data->m_dirtyStart; // update dirty area m_data->m_dirtyStart = m_start; } @@ -347,20 +345,15 @@ Buffer::AddAtStart (uint32_t start) // update dirty area m_data->m_dirtyStart = m_start; m_data->m_dirtyEnd = m_end; - - dirty = true; - } m_maxZeroAreaStart = std::max (m_maxZeroAreaStart, m_zeroAreaStart); LOG_INTERNAL_STATE ("add start=" << start << ", "); NS_ASSERT (CheckInternalState ()); - return dirty; } -bool +void Buffer::AddAtEnd (uint32_t end) { NS_LOG_FUNCTION (this << end); - bool dirty; NS_ASSERT (CheckInternalState ()); bool isDirty = m_data->m_count > 1 && m_end < m_data->m_dirtyEnd; if (GetInternalEnd () + end <= m_data->m_size && !isDirty) @@ -374,9 +367,6 @@ Buffer::AddAtEnd (uint32_t end) m_end += end; // update dirty area. m_data->m_dirtyEnd = m_end; - - dirty = m_end < m_data->m_dirtyEnd; - } else { @@ -400,15 +390,10 @@ Buffer::AddAtEnd (uint32_t end) // update dirty area m_data->m_dirtyStart = m_start; m_data->m_dirtyEnd = m_end; - - dirty = true; - } m_maxZeroAreaStart = std::max (m_maxZeroAreaStart, m_zeroAreaStart); LOG_INTERNAL_STATE ("add end=" << end << ", "); NS_ASSERT (CheckInternalState ()); - - return dirty; } void diff --git a/src/network/model/buffer.h b/src/network/model/buffer.h index ce24b8b84..c2b50ebce 100644 --- a/src/network/model/buffer.h +++ b/src/network/model/buffer.h @@ -496,7 +496,6 @@ private: /** * \param start size to reserve - * \returns true if the buffer needed resizing, false otherwise. * * Add bytes at the start of the Buffer. The * content of these bytes is undefined but debugging @@ -504,10 +503,9 @@ private: * Any call to this method invalidates any Iterator * pointing to this Buffer. */ - bool AddAtStart (uint32_t start); + void AddAtStart (uint32_t start); /** * \param end size to reserve - * \returns true if the buffer needed resizing, false otherwise. * * Add bytes at the end of the Buffer. The * content of these bytes is undefined but debugging @@ -515,7 +513,7 @@ private: * Any call to this method invalidates any Iterator * pointing to this Buffer. */ - bool AddAtEnd (uint32_t end); + void AddAtEnd (uint32_t end); /** * \param o the buffer to append to the end of this buffer.