Tweak BufferIterator::{+=,-=} implementation

This commit is contained in:
Maxime Coste 2015-02-26 21:58:56 +00:00
parent 4bbd8a410e
commit b480d6b419

View File

@ -180,12 +180,14 @@ inline BufferIterator BufferIterator::operator-(ByteCount size) const
inline BufferIterator& BufferIterator::operator+=(ByteCount size) inline BufferIterator& BufferIterator::operator+=(ByteCount size)
{ {
return *this = (*this + size); m_coord = m_buffer->advance(m_coord, size);
return *this;
} }
inline BufferIterator& BufferIterator::operator-=(ByteCount size) inline BufferIterator& BufferIterator::operator-=(ByteCount size)
{ {
return *this = (*this - size); m_coord = m_buffer->advance(m_coord, -size);
return *this;
} }
[[gnu::always_inline]] [[gnu::always_inline]]