diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-04-19 15:12:16 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-04-19 15:12:16 +0100 |
| commit | 1dfa2d7fe465a329a09f9ae4130b0f95b2662325 (patch) | |
| tree | 91a80cc1488132e60ec88a87212b679a2401ac6a /src/context.cc | |
| parent | 9f65a4e6dd735ecdcb4b469b485ff643cd1f54fe (diff) | |
Avoid unneeded update of selections when we are going to overwrite them
Diffstat (limited to 'src/context.cc')
| -rw-r--r-- | src/context.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/context.cc b/src/context.cc index ca186cb1..bd67a6b3 100644 --- a/src/context.cc +++ b/src/context.cc @@ -197,6 +197,13 @@ SelectionList& Context::selections() return *m_selections; } +SelectionList& Context::selections_write_only() +{ + if (not m_selections) + throw runtime_error("no selections in context"); + return *m_selections; +} + const SelectionList& Context::selections() const { return const_cast<Context&>(*this).selections(); |
