diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2012-11-26 18:50:34 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2012-11-26 18:50:34 +0100 |
| commit | e77ca7a4be3adc8d11503b1186b8fac257a1624c (patch) | |
| tree | 280d6b82332be2645208840e216d8b56887e5e00 /src | |
| parent | 9effba2c667cba653e7c8bd78cc86b1d12a10c9b (diff) | |
minor code simplification
Diffstat (limited to 'src')
| -rw-r--r-- | src/editor.cc | 6 | ||||
| -rw-r--r-- | src/selection.hh | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/src/editor.cc b/src/editor.cc index 380c07ba..eeffe41f 100644 --- a/src/editor.cc +++ b/src/editor.cc @@ -306,8 +306,7 @@ bool Editor::undo() if (res) { m_selections.clear(); - m_selections.push_back(Selection(listener.first(), - listener.last())); + m_selections.emplace_back(listener.first(), listener.last()); } return res; } @@ -319,8 +318,7 @@ bool Editor::redo() if (res) { m_selections.clear(); - m_selections.push_back(Selection(listener.first(), - listener.last())); + m_selections.emplace_back(listener.first(), listener.last()); } return res; } diff --git a/src/selection.hh b/src/selection.hh index 3de6937e..a75c9e3c 100644 --- a/src/selection.hh +++ b/src/selection.hh @@ -62,13 +62,11 @@ struct SelectionAndCaptures SelectionAndCaptures(const BufferIterator& first, const BufferIterator& last, - CaptureList captures_list) + CaptureList captures_list = {}) : selection(first, last), captures(std::move(captures_list)) {} SelectionAndCaptures(const Selection& sel, - CaptureList captures_list) + CaptureList captures_list = {}) : selection(sel), captures(std::move(captures_list)) {} - SelectionAndCaptures(const Selection& sel) - : selection(sel) {} // helper to access the selection BufferIterator begin() const { return selection.begin(); } |
