summaryrefslogtreecommitdiff
path: root/src/context.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-04-19 15:12:16 +0100
committerMaxime Coste <frrrwww@gmail.com>2015-04-19 15:12:16 +0100
commit1dfa2d7fe465a329a09f9ae4130b0f95b2662325 (patch)
tree91a80cc1488132e60ec88a87212b679a2401ac6a /src/context.cc
parent9f65a4e6dd735ecdcb4b469b485ff643cd1f54fe (diff)
Avoid unneeded update of selections when we are going to overwrite them
Diffstat (limited to 'src/context.cc')
-rw-r--r--src/context.cc7
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();