From 3e499c1a3153619005e1e68acff01d1371cc971b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 29 Nov 2015 17:49:56 +1100 Subject: Cleanup: sync edgehash w/ ghash remove logic --- source/blender/blenlib/intern/BLI_ghash.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (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 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; -- cgit v1.2.3