From ed33320e3f149f4106ed70b82d019113970c991e Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Wed, 16 May 2012 00:51:36 +0000 Subject: Code cleanup: simplify standard GHash creation. Added four new functions as shortcuts to creating GHashes that use the standard ptr/str/int/pair hash and compare functions. GHash *BLI_ghash_ptr_new(const char *info); GHash *BLI_ghash_str_new(const char *info); GHash *BLI_ghash_int_new(const char *info); GHash *BLI_ghash_pair_new(const char *info); Replaced almost all occurrences of BLI_ghash_new() with one of the above functions. --- source/blender/python/intern/bpy_rna.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/python') diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 6c1e811aae0..f20e029c7b6 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -176,13 +176,13 @@ static GHash *id_weakref_pool_get(ID *id) } else { /* first time, allocate pool */ - id_weakref_pool = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "rna_global_pool"); + id_weakref_pool = BLI_ghash_ptr_new("rna_global_pool"); weakinfo_hash = NULL; } if (weakinfo_hash == NULL) { /* we're using a ghash as a set, could use libHX's HXMAP_SINGULAR but would be an extra dep. */ - weakinfo_hash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "rna_id"); + weakinfo_hash = BLI_ghash_ptr_new("rna_id"); BLI_ghash_insert(id_weakref_pool, (void *)id, weakinfo_hash); } -- cgit v1.2.3