summaryrefslogtreecommitdiffstats
path: root/src/engine/GraphObjectImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/GraphObjectImpl.cpp')
-rw-r--r--src/engine/GraphObjectImpl.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/engine/GraphObjectImpl.cpp b/src/engine/GraphObjectImpl.cpp
index 71730202..ef4e2cd4 100644
--- a/src/engine/GraphObjectImpl.cpp
+++ b/src/engine/GraphObjectImpl.cpp
@@ -30,7 +30,14 @@ using namespace Shared;
void
GraphObjectImpl::set_variable(const Raul::URI& key, const Atom& value)
{
- _variables[key] = value;
+ // Ignore duplicate statements
+ typedef Resource::Properties::const_iterator iterator;
+ const std::pair<iterator,iterator> range = _variables.equal_range(key);
+ for (iterator i = range.first; i != range.second; ++i)
+ if (i->second == value)
+ return;
+
+ _variables.insert(make_pair(key, value));
}