From 474190b330ce48bb0b3b1ea975d1cbd03dcff28c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 11 Mar 2011 00:09:07 +0000 Subject: Leaner slv2_plugin_is_replaced implementation. git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@3067 a436a847-0d15-0410-975c-d299462d15a1 --- src/world.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'src') 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 -- cgit v1.2.1