diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-02-27 19:03:33 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-02-27 19:03:33 +0100 |
| commit | be0c5ddf49b30700d61515ef79d1909f0a6344f8 (patch) | |
| tree | 0446874f9b36922a7534822581617dcade8a26f0 /src/dynamic_selection_list.cc | |
| parent | cd8c36fc500dc0df5fb4232a8b1b94ab89495737 (diff) | |
minor performance tweaks
Diffstat (limited to 'src/dynamic_selection_list.cc')
| -rw-r--r-- | src/dynamic_selection_list.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/dynamic_selection_list.cc b/src/dynamic_selection_list.cc index a0152341..b684ec56 100644 --- a/src/dynamic_selection_list.cc +++ b/src/dynamic_selection_list.cc @@ -63,28 +63,34 @@ DynamicSelectionList& DynamicSelectionList::operator=(SelectionList selections) void DynamicSelectionList::check_invariant() const { +#ifdef KAK_DEBUG for (auto& sel : *this) { assert(m_buffer == &sel.buffer()); sel.check_invariant(); } +#endif } void DynamicSelectionList::on_insert(const BufferIterator& begin, const BufferIterator& end) { + const BufferCoord begin_coord{begin.coord()}; + const BufferCoord end_coord{end.coord()}; for (auto& sel : *this) { - sel.first().on_insert(begin.coord(), end.coord()); - sel.last().on_insert(begin.coord(), end.coord()); + sel.first().on_insert(begin_coord, end_coord); + sel.last().on_insert(begin_coord, end_coord); } } void DynamicSelectionList::on_erase(const BufferIterator& begin, const BufferIterator& end) { + const BufferCoord begin_coord{begin.coord()}; + const BufferCoord end_coord{end.coord()}; for (auto& sel : *this) { - sel.first().on_erase(begin.coord(), end.coord()); - sel.last().on_erase(begin.coord(), end.coord()); + sel.first().on_erase(begin_coord, end_coord); + sel.last().on_erase(begin_coord, end_coord); } } |
