From 3aee1c37fb7345da33d0ed84e7f4b8b83de7dab2 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 13 Dec 2012 14:34:33 +0100 Subject: [PATCH] perf tweak in BufferIterator --- src/buffer_iterator.inl.hh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/buffer_iterator.inl.hh b/src/buffer_iterator.inl.hh index 950b7dfb..201ea481 100644 --- a/src/buffer_iterator.inl.hh +++ b/src/buffer_iterator.inl.hh @@ -110,8 +110,7 @@ inline void BufferIterator::on_erase(const BufferCoord& begin, inline char BufferIterator::operator*() const { - assert(m_buffer); - return m_buffer->m_lines[line()].content[column()]; + return m_buffer->m_lines[m_coord.line].content[m_coord.column]; } inline ByteCount BufferIterator::offset() const @@ -172,9 +171,9 @@ inline BufferIterator& BufferIterator::operator-=(ByteCount size) inline BufferIterator& BufferIterator::operator++() { - if (column() < m_buffer->m_lines[line()].length() - 1) + if (m_coord.column < m_buffer->m_lines[m_coord.line].length() - 1) ++m_coord.column; - else if (line() == m_buffer->line_count() - 1) + else if (m_coord.line == m_buffer->m_lines.size() - 1) m_coord.column = m_buffer->m_lines.back().length(); else {