From 7bd3f4306ddb030d6f7c70f3bcb0fa4e9b6ac4b4 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 10 Nov 2015 23:06:57 +0000 Subject: Remove useless checks, buffer has always at list one line --- src/buffer.cc | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/buffer.cc') diff --git a/src/buffer.cc b/src/buffer.cc index 8ca9aae8..70183b2b 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -142,9 +142,6 @@ BufferIterator Buffer::iterator_at(ByteCoord coord) const ByteCoord Buffer::clamp(ByteCoord coord) const { - if (m_lines.empty()) - return ByteCoord{}; - coord.line = Kakoune::clamp(coord.line, 0_line, line_count() - 1); ByteCount max_col = std::max(0_byte, m_lines[coord.line].length() - 1); coord.column = Kakoune::clamp(coord.column, 0_byte, max_col); -- cgit v1.2.3