From 15692c8cfe5aac896227cfd4594e0a6f84df01b0 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 30 May 2017 11:09:44 +0200 Subject: Move hash_combine utility function to a more generic place This way everyone can benefit from it, not only dependency graph. --- source/blender/blenlib/intern/BLI_ghash.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to '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 944ee18e6b2..d1fe3557801 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -1225,6 +1225,11 @@ bool BLI_ghashutil_intcmp(const void *a, const void *b) return (a != b); } +size_t BLI_ghashutil_combine_hash(size_t hash_a, size_t hash_b) +{ + return hash_a ^ (hash_b + 0x9e3779b9 + (hash_a << 6) + (hash_a >> 2)); +} + /** * This function implements the widely used "djb" hash apparently posted * by Daniel Bernstein to comp.lang.c some time ago. The 32 bit -- cgit v1.2.3