diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-08 09:50:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-08 09:50:38 +0400 |
commit | 5580afb5dfe98771c7db8b0660398c47751c1ade (patch) | |
tree | f99c7913a62f561a29dd6abc918868232275ce24 /source/blender/blenlib/intern/BLI_ghash.c | |
parent | ebaf3781fa4165808cd9ddb2ed0944788a31af7c (diff) |
GHash/Edgehash: make simple iterator checking functions inline.
also remove NULL check, only a few areas made use of this.
Diffstat (limited to 'source/blender/blenlib/intern/BLI_ghash.c')
-rw-r--r-- | source/blender/blenlib/intern/BLI_ghash.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index 169b98da267..e30883611a8 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -577,6 +577,8 @@ void BLI_ghashIterator_free(GHashIterator *ghi) MEM_freeN(ghi); } +/* inline functions now */ +#if 0 /** * Retrieve the key from an iterator. * @@ -586,7 +588,7 @@ void BLI_ghashIterator_free(GHashIterator *ghi) */ void *BLI_ghashIterator_getKey(GHashIterator *ghi) { - return ghi->curEntry ? ghi->curEntry->key : NULL; + return ghi->curEntry->key; } /** @@ -598,7 +600,7 @@ void *BLI_ghashIterator_getKey(GHashIterator *ghi) */ void *BLI_ghashIterator_getValue(GHashIterator *ghi) { - return ghi->curEntry ? ghi->curEntry->val : NULL; + return ghi->curEntry->val; } /** @@ -610,8 +612,21 @@ void *BLI_ghashIterator_getValue(GHashIterator *ghi) */ void **BLI_ghashIterator_getValue_p(GHashIterator *ghi) { - return ghi->curEntry ? &ghi->curEntry->val : NULL; + return &ghi->curEntry->val; +} + +/** + * Determine if an iterator is done (has reached the end of + * the hash table). + * + * \param ghi The iterator. + * \return True if done, False otherwise. + */ +bool BLI_ghashIterator_done(GHashIterator *ghi) +{ + return ghi->curEntry == NULL; } +#endif /** * Steps the iterator to the next index. @@ -631,18 +646,6 @@ void BLI_ghashIterator_step(GHashIterator *ghi) } } -/** - * Determine if an iterator is done (has reached the end of - * the hash table). - * - * \param ghi The iterator. - * \return True if done, False otherwise. - */ -bool BLI_ghashIterator_done(GHashIterator *ghi) -{ - return ghi->curEntry == NULL; -} - /** \} */ |