diff options
author | David Robillard <d@drobilla.net> | 2011-05-13 03:52:42 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-05-13 03:52:42 +0000 |
commit | 78f77da4ceeddd757cb971315f185a163c5b456d (patch) | |
tree | 3ed2a1a3dc4947047d788717eba276f5d00bef0c /src | |
parent | dfb0795932f0e06873c538c13dcdd3a4d9e3b5b2 (diff) | |
download | sord-78f77da4ceeddd757cb971315f185a163c5b456d.tar.gz sord-78f77da4ceeddd757cb971315f185a163c5b456d.tar.bz2 sord-78f77da4ceeddd757cb971315f185a163c5b456d.zip |
Remove pointless sord_id_compare function (cruft from disk days).
git-svn-id: http://svn.drobilla.net/sord/trunk@113 3d64ff67-21c5-427c-a301-fe4f08042e5a
Diffstat (limited to 'src')
-rw-r--r-- | src/sord.c | 30 |
1 files changed, 5 insertions, 25 deletions
@@ -180,10 +180,8 @@ sord_world_free(SordWorld* world) static inline int sord_node_compare(const SordNode* a, const SordNode* b) { - if (a == b) { - return 0; - } else if (!a || !b) { - return a - b; + if (a == b || !a || !b) { + return (const char*)a - (const char*)b; } else if (a->node.type != b->node.type) { return a->node.type - b->node.type; } @@ -225,23 +223,6 @@ sord_node_equals(const SordNode* a, const SordNode* b) } } -/** Compare two IDs (dereferencing if necessary). - * The null ID, 0, is treated as a minimum (it is less than every other - * possible ID, except itself). This allows it to be used as a wildcard - * when searching, ensuring the search will reach the minimum possible - * key in the tree and iteration from that point will produce the entire - * result set. - */ -static inline int -sord_id_compare(SordModel* sord, const SordNode* a, const SordNode* b) -{ - if (a == b || !a || !b) { - return (const char*)a - (const char*)b; - } else { - return sord_node_compare(a, b); - } -} - /** Return true iff IDs are equivalent, or one is a wildcard */ static inline bool sord_id_match(const SordNode* a, const SordNode* b) @@ -271,12 +252,11 @@ sord_quad_match(const SordQuad x, const SordQuad y) static int sord_quad_compare(const void* x_ptr, const void* y_ptr, void* user_data) { - SordModel* const sord = (SordModel*)user_data; - SordNode** const x = (SordNode**)x_ptr; - SordNode** const y = (SordNode**)y_ptr; + SordNode** const x = (SordNode**)x_ptr; + SordNode** const y = (SordNode**)y_ptr; for (int i = 0; i < TUP_LEN; ++i) { - const int cmp = sord_id_compare(sord, x[i], y[i]); + const int cmp = sord_node_compare(x[i], y[i]); if (cmp) return cmp; } |