minor refactoring in highlight_range

This commit is contained in:
Maxime Coste 2012-12-12 19:33:29 +01:00
parent 52f63b96b6
commit bf07d2576e

View File

@ -24,8 +24,9 @@ void highlight_range(DisplayBuffer& display_buffer,
for (auto& line : display_buffer.lines()) for (auto& line : display_buffer.lines())
{ {
if (line.buffer_line() >= begin.line() and line.buffer_line() <= end.line()) if (line.buffer_line() < begin.line() or end.line() < line.buffer_line())
{ continue;
for (auto atom_it = line.begin(); atom_it != line.end(); ++atom_it) for (auto atom_it = line.begin(); atom_it != line.end(); ++atom_it)
{ {
bool is_replaced = atom_it->content.type() == AtomContent::ReplacedBufferRange; bool is_replaced = atom_it->content.type() == AtomContent::ReplacedBufferRange;
@ -50,7 +51,6 @@ void highlight_range(DisplayBuffer& display_buffer,
func(*atom_it); func(*atom_it);
} }
} }
}
} }
typedef std::unordered_map<size_t, const ColorPair*> ColorSpec; typedef std::unordered_map<size_t, const ColorPair*> ColorSpec;