summaryrefslogtreecommitdiffstats
path: root/src/plugin.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-11-23 02:36:26 +0000
committerDavid Robillard <d@drobilla.net>2012-11-23 02:36:26 +0000
commitf7963514ecc6b09717e5a5b49845cb0043145e37 (patch)
tree2abc5e87919893e554b30314ad04d0137fab2672 /src/plugin.c
parent3a779910b25092981e7dd84d976987e7556916a4 (diff)
downloadlilv-f7963514ecc6b09717e5a5b49845cb0043145e37.tar.gz
lilv-f7963514ecc6b09717e5a5b49845cb0043145e37.tar.bz2
lilv-f7963514ecc6b09717e5a5b49845cb0043145e37.zip
Factor out common "ask if a triple is present" pattern.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@4856 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/plugin.c')
-rw-r--r--src/plugin.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/plugin.c b/src/plugin.c
index 758790b..4decba7 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -719,18 +719,11 @@ lilv_plugin_has_extension_data(const LilvPlugin* p,
return false;
}
- SordIter* iter = lilv_world_query_internal(
+ return lilv_world_ask_internal(
p->world,
p->plugin_uri->node,
p->world->uris.lv2_extensionData,
uri->node);
-
- if (iter) {
- sord_iter_free(iter);
- return true;
- } else {
- return false;
- }
}
LILV_API
@@ -951,14 +944,12 @@ lilv_plugin_get_related(const LilvPlugin* plugin, const LilvNode* type)
LilvNodes* matches = lilv_nodes_new();
LILV_FOREACH(nodes, i, related) {
LilvNode* node = (LilvNode*)lilv_collection_get((ZixTree*)related, i);
- SordIter* titer = lilv_world_query_internal(
- world, node->node, world->uris.rdf_a, type->node);
- if (!sord_iter_end(titer)) {
+ if (lilv_world_ask_internal(
+ world, node->node, world->uris.rdf_a, type->node)) {
zix_tree_insert((ZixTree*)matches,
lilv_node_new_from_node(world, node->node),
NULL);
}
- sord_iter_free(titer);
}
lilv_nodes_free(related);