From 05f9e858a5dd4b3a1ba5047aa703e55da70dcfdf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 11 Jul 2016 19:30:04 -0400 Subject: Improve test coverage --- src/world.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/world.c') diff --git a/src/world.c b/src/world.c index b608261..d08e32d 100644 --- a/src/world.c +++ b/src/world.c @@ -335,15 +335,12 @@ lilv_lib_compare(const void* a, const void* b, void* user_data) static ZixTreeIter* lilv_collection_find_by_uri(const ZixTree* seq, const LilvNode* uri) { - if (!lilv_node_is_uri(uri)) { - return NULL; + ZixTreeIter* i = NULL; + if (lilv_node_is_uri(uri)) { + struct LilvHeader key = { NULL, (LilvNode*)uri }; + zix_tree_find(seq, &key, &i); } - - struct LilvHeader key = { NULL, (LilvNode*)uri }; - ZixTreeIter* i = NULL; - const ZixStatus st = zix_tree_find(seq, &key, &i); - - return st ? NULL : i; + return i; } /** Get an element of a collection of any object with an LilvHeader by URI. */ -- cgit v1.2.1