diff options
author | David Robillard <d@drobilla.net> | 2011-05-24 18:56:42 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-05-24 18:56:42 +0000 |
commit | dbd8fdc5bb5f50ff030259d1ea5a382325658e43 (patch) | |
tree | 4bfa5a470315d98af7ccac6cbb4dfc03be8a3043 /src/node.c | |
parent | 876c5e305254158827ca5f70d7ec138af3f09ff0 (diff) | |
download | lilv-dbd8fdc5bb5f50ff030259d1ea5a382325658e43.tar.gz lilv-dbd8fdc5bb5f50ff030259d1ea5a382325658e43.tar.bz2 lilv-dbd8fdc5bb5f50ff030259d1ea5a382325658e43.zip |
Re-use the SordNode of blank nodes when copying.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3309 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/node.c')
-rw-r--r-- | src/node.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -105,6 +105,13 @@ lilv_node_new_from_node(LilvWorld* world, const SordNode* node) result->val.uri_val = sord_node_copy(node); result->str_val = (char*)sord_node_get_string(result->val.uri_val); break; + case SORD_BLANK: + result = malloc(sizeof(struct LilvNodeImpl)); + result->world = (LilvWorld*)world; + result->type = LILV_VALUE_BLANK; + result->val.uri_val = sord_node_copy(node); + result->str_val = (char*)sord_node_get_string(result->val.uri_val); + break; case SORD_LITERAL: datatype_uri = sord_node_get_datatype(node); if (datatype_uri) { @@ -129,10 +136,6 @@ lilv_node_new_from_node(LilvWorld* world, const SordNode* node) break; } break; - case SORD_BLANK: - result = lilv_node_new(world, LILV_VALUE_BLANK, - (const char*)sord_node_get_string(node)); - break; default: assert(false); } |