diff options
author | David Robillard <d@drobilla.net> | 2011-04-30 01:40:20 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-04-30 01:40:20 +0000 |
commit | 054c39b12cb610d79006f0b51153cb2c4aa5a0b7 (patch) | |
tree | 3f96f5d9f17a61bba50f12227e510a033cda5e8a /src/plugin.c | |
parent | 2aebf86c27288254da4765116686101a88840cbd (diff) | |
download | lilv-054c39b12cb610d79006f0b51153cb2c4aa5a0b7.tar.gz lilv-054c39b12cb610d79006f0b51153cb2c4aa5a0b7.tar.bz2 lilv-054c39b12cb610d79006f0b51153cb2c4aa5a0b7.zip |
Cache port RDF node on load instead of searching for it repeatedly.
Consistent namespace and URI define names.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3240 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/plugin.c')
-rw-r--r-- | src/plugin.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/plugin.c b/src/plugin.c index 32c40da..25ae481 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -69,8 +69,9 @@ lilv_plugin_free(LilvPlugin* p) #endif if (p->ports) { - for (uint32_t i = 0; i < p->num_ports; ++i) - lilv_port_free(p->ports[i]); + for (uint32_t i = 0; i < p->num_ports; ++i) { + lilv_port_free(p, p->ports[i]); + } free(p->ports); p->ports = NULL; } @@ -184,9 +185,9 @@ lilv_plugin_load_ports_if_necessary(const LilvPlugin* const_p) NULL); FOREACH_MATCH(ports) { - LilvNode* index = NULL; - const SordNode* port = lilv_match_object(ports); - LilvNode* symbol = lilv_plugin_get_unique( + LilvNode* index = NULL; + const SordNode* port = lilv_match_object(ports); + LilvNode* symbol = lilv_plugin_get_unique( p, port, p->world->lv2_symbol_node); if (!lilv_node_is_string(symbol)) { @@ -217,6 +218,7 @@ lilv_plugin_load_ports_if_necessary(const LilvPlugin* const_p) // Havn't seen this port yet, add it to array if (!this_port) { this_port = lilv_port_new(p->world, + port, this_index, lilv_node_as_string(symbol)); p->ports[this_index] = this_port; @@ -241,8 +243,9 @@ lilv_plugin_load_ports_if_necessary(const LilvPlugin* const_p) lilv_node_free(index); if (p->num_ports == 0) { if (p->ports) { - for (uint32_t i = 0; i < p->num_ports; ++i) - lilv_port_free(p->ports[i]); + for (uint32_t i = 0; i < p->num_ports; ++i) { + lilv_port_free(p, p->ports[i]); + } free(p->ports); p->ports = NULL; } |