From 3dd82a2b8515fccbd5a31a90f5da4d969dbb4a23 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 19 Mar 2012 14:04:33 +0000 Subject: [PATCH] get rid of Buffer::at --- src/buffer.cc | 5 ----- src/buffer.hh | 2 -- src/buffer_iterator.inl.hh | 2 +- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/buffer.cc b/src/buffer.cc index 1e86f5c4..fb4c61ad 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -128,11 +128,6 @@ String Buffer::string(const BufferIterator& begin, const BufferIterator& end) co return m_content.substr(begin.m_position, end - begin); } -BufferChar Buffer::at(BufferPos position) const -{ - return m_content[position]; -} - void Buffer::begin_undo_group() { assert(m_current_undo_group.empty()); diff --git a/src/buffer.hh b/src/buffer.hh index 00b7764c..60e6f7e2 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -167,8 +167,6 @@ public: BufferIterator iterator_at_line_end(const BufferIterator& iterator) const; private: - BufferChar at(BufferPos position) const; - friend class BufferIterator; std::vector m_lines; diff --git a/src/buffer_iterator.inl.hh b/src/buffer_iterator.inl.hh index feae368d..d7def812 100644 --- a/src/buffer_iterator.inl.hh +++ b/src/buffer_iterator.inl.hh @@ -69,7 +69,7 @@ inline bool BufferIterator::operator>=(const BufferIterator& iterator) const inline BufferChar BufferIterator::operator*() const { assert(m_buffer); - return m_buffer->at(m_position); + return m_buffer->m_content[m_position]; } inline BufferSize BufferIterator::operator-(const BufferIterator& iterator) const