[Bf-blender-cvs] [7157f3d] master: GHash: no reason to use GSetEntry in ghash API

Campbell Barton noreply at git.blender.org
Mon Apr 6 01:08:32 CEST 2015


Commit: 7157f3dbce257d9f9a0df7b243e306949fb9678e
Author: Campbell Barton
Date:   Mon Apr 6 09:03:32 2015 +1000
Branches: master
https://developer.blender.org/rB7157f3dbce257d9f9a0df7b243e306949fb9678e

GHash: no reason to use GSetEntry in ghash API

===================================================================

M	source/blender/blenlib/intern/BLI_ghash.c

===================================================================

diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index f2705c7..1184880 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -162,7 +162,7 @@ BLI_INLINE unsigned int ghash_bucket_index(GHash *gh, const unsigned int hash)
 #ifdef GHASH_USE_MODULO_BUCKETS
 	return hash % gh->nbuckets;
 #else
-	return full_hash & gh->bucket_mask;
+	return hash & gh->bucket_mask;
 #endif
 }
 
@@ -450,14 +450,14 @@ BLI_INLINE void ghash_insert_ex(
 BLI_INLINE void ghash_insert_ex_keyonly(
         GHash *gh, void *key, const unsigned int bucket_index)
 {
-	GSetEntry *e = BLI_mempool_alloc(gh->entrypool);
+	Entry *e = BLI_mempool_alloc(gh->entrypool);
 
 	BLI_assert((gh->flag & GHASH_FLAG_ALLOW_DUPES) || (BLI_ghash_haskey(gh, key) == 0));
 	BLI_assert((gh->flag & GHASH_FLAG_IS_GSET) != 0);
 
 	e->next = gh->buckets[bucket_index];
 	e->key = key;
-	gh->buckets[bucket_index] = (Entry *)e;
+	gh->buckets[bucket_index] = e;
 
 	ghash_buckets_expand(gh, ++gh->nentries, false);
 }
@@ -498,7 +498,7 @@ BLI_INLINE bool ghash_insert_safe_keyonly(GHash *gh, void *key, const bool overr
 {
 	const unsigned int hash = ghash_keyhash(gh, key);
 	const unsigned int bucket_index = ghash_bucket_index(gh, hash);
-	GSetEntry *e = ghash_lookup_entry_ex(gh, key, bucket_index);
+	Entry *e = ghash_lookup_entry_ex(gh, key, bucket_index);
 
 	BLI_assert((gh->flag & GHASH_FLAG_IS_GSET) != 0);




More information about the Bf-blender-cvs mailing list