Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-04-11 16:36:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-04-11 16:36:37 +0300
commitccf44c400c896761c87836a06be24216c366c87b (patch)
tree5b6b677b19008c1eb2d89b6c172c33622a698c7c /source/blender/blenlib/intern/BLI_ghash.c
parent7447a0173cc841a1e9bd3f655c3230382c1e7cb7 (diff)
BMesh: simplify hashing for dyntopo
Was using pointer hashing when the keys are in fact uint's. Since they're well distributed from the rangetree, no need to do bit-shifting tricks. just use int as hash. Gives ~8% speedup in own tests.
Diffstat (limited to 'source/blender/blenlib/intern/BLI_ghash.c')
-rw-r--r--source/blender/blenlib/intern/BLI_ghash.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index dae7af6a927..484fe70104e 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -1091,6 +1091,11 @@ unsigned int BLI_ghashutil_inthash_p_murmur(const void *ptr)
return BLI_hash_mm2((const unsigned char *)&key, sizeof(key), 0);
}
+unsigned int BLI_ghashutil_inthash_p_simple(const void *ptr)
+{
+ return GET_UINT_FROM_POINTER(ptr);
+}
+
bool BLI_ghashutil_intcmp(const void *a, const void *b)
{
return (a != b);