diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-11-29 09:49:56 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-11-29 09:51:12 +0300 |
commit | 3e499c1a3153619005e1e68acff01d1371cc971b (patch) | |
tree | abc876269e34c0cc3f7cb43eeb7d43af0e9be65b /source/blender/blenlib/intern/BLI_ghash.c | |
parent | 09c2bff32f411e1c9f100526d04de6430fa8cc43 (diff) |
Cleanup: sync edgehash w/ ghash remove logic
Diffstat (limited to 'source/blender/blenlib/intern/BLI_ghash.c')
-rw-r--r-- | source/blender/blenlib/intern/BLI_ghash.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index aa412fe005d..29b07b37932 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -378,13 +378,12 @@ BLI_INLINE Entry *ghash_lookup_entry_ex( * Useful when modifying buckets somehow (like removing an entry...). */ BLI_INLINE Entry *ghash_lookup_entry_prev_ex( - GHash *gh, const void *key, Entry **r_e_prev, const unsigned int bucket_index) + GHash *gh, const void *key, + Entry **r_e_prev, const unsigned int bucket_index) { - Entry *e, *e_prev = NULL; - /* If we do not store GHash, not worth computing it for each entry here! * Typically, comparison function will be quicker, and since it's needed in the end anyway... */ - for (e = gh->buckets[bucket_index]; e; e_prev = e, e = e->next) { + for (Entry *e_prev = NULL, *e = gh->buckets[bucket_index]; e; e_prev = e, e = e->next) { if (UNLIKELY(gh->cmpfp(key, e->key) == false)) { *r_e_prev = e_prev; return e; |