diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Resource.cpp | 20 | ||||
-rw-r--r-- | src/server/events/Delta.cpp | 6 |
2 files changed, 10 insertions, 16 deletions
diff --git a/src/Resource.cpp b/src/Resource.cpp index d8659596..e7271634 100644 --- a/src/Resource.cpp +++ b/src/Resource.cpp @@ -71,8 +71,9 @@ Resource::remove_property(const Raul::URI& uri, const Raul::Atom& value) if (value == _uris.wildcard) { _properties.erase(uri); } else { - Properties::iterator i = _properties.find(uri); - for (; (i != _properties.end()) && (i->first == uri); ++i) { + for (Properties::iterator i = _properties.find(uri); + i != _properties.end() && (i->first == uri); + ++i) { if (i->second == value) { _properties.erase(i); return; @@ -180,19 +181,8 @@ void Resource::remove_properties(const Properties& p) { typedef Resource::Properties::const_iterator iterator; - for (iterator i = p.begin(); i != p.end(); ++i) { - if (i->second == _uris.wildcard) { - _properties.erase(i->first); - } else { - for (Properties::iterator j = _properties.find(i->first); - (j != _properties.end()) && (j->first == i->first); ++j) { - if (j->second == i->second) { - _properties.erase(j); - break; - } - } - } - } + for (iterator i = p.begin(); i != p.end(); ++i) + remove_property(i->first, i->second); } Resource::Properties diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index a497bb37..6892ccbc 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -67,7 +67,11 @@ Delta::Delta(Engine& engine, , _create(create) { if (context != Resource::DEFAULT) { - Resource::set_context(_properties, context); + for (Properties::iterator i = _properties.begin(); + i != _properties.end(); + ++i) { + i->second.set_context(context); + } } #ifdef DUMP |