diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-09-25 00:15:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-09-25 00:16:37 +0400 |
commit | 6f2f80887b10f6a704a7394f0580e6ee39ea611d (patch) | |
tree | f27b5f9f2d009e2784fc058c22581a95b9d834da /source/blender/blenkernel/intern/node.c | |
parent | faaf0c719f3310759bf5f2c9be76f6788a923364 (diff) |
GHash: use bool for comparison (simplify compare)
Diffstat (limited to 'source/blender/blenkernel/intern/node.c')
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 0f86b551092..3a7bfb03e07 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -2682,16 +2682,12 @@ static unsigned int node_instance_hash_key(const void *key) return ((const bNodeInstanceKey *)key)->value; } -static int node_instance_hash_key_cmp(const void *a, const void *b) +static bool node_instance_hash_key_cmp(const void *a, const void *b) { unsigned int value_a = ((const bNodeInstanceKey *)a)->value; unsigned int value_b = ((const bNodeInstanceKey *)b)->value; - if (value_a == value_b) - return 0; - else if (value_a < value_b) - return -1; - else - return 1; + + return (value_a != value_b); } bNodeInstanceHash *BKE_node_instance_hash_new(const char *info) |