Small style tweak

This commit is contained in:
Maxime Coste 2017-06-07 11:40:13 +01:00
parent 5a5d2ad7cb
commit 21da24235a

View File

@ -196,7 +196,8 @@ BufferCoordAndTarget Buffer::offset_coord(BufferCoordAndTarget coord, LineCount
String Buffer::string(BufferCoord begin, BufferCoord end) const String Buffer::string(BufferCoord begin, BufferCoord end) const
{ {
String res; String res;
for (auto line = begin.line; line <= end.line and line < line_count(); ++line) const auto last_line = std::min(end.line, line_count()-1);
for (auto line = begin.line; line <= last_line; ++line)
{ {
ByteCount start = 0; ByteCount start = 0;
if (line == begin.line) if (line == begin.line)