summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-03-11 00:09:07 +0000
committerDavid Robillard <d@drobilla.net>2011-03-11 00:09:07 +0000
commit474190b330ce48bb0b3b1ea975d1cbd03dcff28c (patch)
tree28a3228691f7e15a123f828a64b626cd0edcae45 /src
parent0ad295a550f8637cbc71cf15652f94a0cba763d6 (diff)
downloadlilv-474190b330ce48bb0b3b1ea975d1cbd03dcff28c.tar.gz
lilv-474190b330ce48bb0b3b1ea975d1cbd03dcff28c.tar.bz2
lilv-474190b330ce48bb0b3b1ea975d1cbd03dcff28c.zip
Leaner slv2_plugin_is_replaced implementation.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@3067 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/world.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/world.c b/src/world.c
index f014d1a..df97e7a 100644
--- a/src/world.c
+++ b/src/world.c
@@ -668,30 +668,19 @@ slv2_world_load_all(SLV2World world)
SLV2Value plugin_uri = slv2_plugin_get_uri(plugin);
// ?new dc:replaces plugin
- SLV2Matches replacements = slv2_world_find_statements(
+ SLV2Matches replacement = slv2_world_find_statements(
world, world->model,
NULL,
world->dc_replaces_node,
slv2_value_as_node(plugin_uri),
NULL);
- FOREACH_MATCH(replacements) {
- SLV2Node subject = slv2_match_subject(replacements);
- SLV2Node object = slv2_match_object(replacements);
- if (sord_node_get_type(subject) != SORD_URI
- || sord_node_get_type(object) != SORD_URI) {
- continue;
- }
-
- SLV2Value subject_val = slv2_value_new_from_node(world, subject);
- SLV2Value object_val = slv2_value_new_from_node(world, object);
-
- fprintf(stderr, "%s REPLACES %s\n",
- slv2_value_as_uri(subject_val),
- slv2_value_as_uri(object_val));
-
+ if (!sord_iter_end(replacement)) {
+ /* TODO: Check if replacement is actually a known plugin,
+ though this is expensive...
+ */
plugin->replaced = true;
}
- slv2_match_end(replacements);
+ slv2_match_end(replacement);
}
// Query out things to cache