summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buffer.hh1
-rw-r--r--src/buffer.inl.hh3
2 files changed, 1 insertions, 3 deletions
diff --git a/src/buffer.hh b/src/buffer.hh
index 0cdb8209..3114e861 100644
--- a/src/buffer.hh
+++ b/src/buffer.hh
@@ -92,7 +92,6 @@ public:
private:
SafePtr<const Buffer> m_buffer;
BufferCoord m_coord;
- LineCount m_line_count;
StringView m_line;
};
diff --git a/src/buffer.inl.hh b/src/buffer.inl.hh
index 6816e818..e7538694 100644
--- a/src/buffer.inl.hh
+++ b/src/buffer.inl.hh
@@ -100,7 +100,6 @@ inline BufferCoord Buffer::end_coord() const
inline BufferIterator::BufferIterator(const Buffer& buffer, BufferCoord coord) noexcept
: m_buffer{&buffer}, m_coord{coord},
- m_line_count{buffer.line_count()},
m_line{coord.line < buffer.line_count() ? (*m_buffer)[coord.line] : StringView{}} {}
inline bool BufferIterator::operator==(const BufferIterator& iterator) const noexcept
@@ -183,7 +182,7 @@ inline BufferIterator& BufferIterator::operator++()
{
if (++m_coord.column == m_line.length())
{
- m_line = (++m_coord.line < m_line_count) ?
+ m_line = (++m_coord.line < m_buffer->line_count()) ?
(*m_buffer)[m_coord.line] : StringView{};
m_coord.column = 0;
}