diff options
author | David Robillard <d@drobilla.net> | 2012-07-31 00:37:01 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-07-31 00:37:01 +0000 |
commit | 88f9a3bf23fc629385978633a8764d74788e1fdc (patch) | |
tree | 7bdc812f3bbe0c98d2c138fd1cbd0030999060f6 /src | |
parent | 629fb50716083c71146340de97eb8651679ca9fb (diff) | |
download | ingen-88f9a3bf23fc629385978633a8764d74788e1fdc.tar.gz ingen-88f9a3bf23fc629385978633a8764d74788e1fdc.tar.bz2 ingen-88f9a3bf23fc629385978633a8764d74788e1fdc.zip |
Clean up Resource.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4580 a436a847-0d15-0410-975c-d299462d15a1
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 |