diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-18 07:41:39 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-18 07:41:39 +0400 |
commit | 754b4ab3bcbc92df0bcdff4848ef5ffc9410dce2 (patch) | |
tree | fa1dd64c56c0822962369d2d095f66b76f758e3a /source/blender/blenkernel/intern/pbvh_bmesh.c | |
parent | 7cce5563445a5363f9d125bf8c3cb30734cabdfe (diff) |
add hash function BLI_ghash_assign, BLI_edgehash_assign
avoids remove,insert and only hashes the key once.
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh_bmesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/pbvh_bmesh.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c index e19b71c14ed..0e2e2bcfe19 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.c +++ b/source/blender/blenkernel/intern/pbvh_bmesh.c @@ -367,12 +367,12 @@ static void pbvh_bmesh_vert_ownership_transfer(PBVH *bvh, PBVHNode *new_owner, BLI_assert(current_owner != new_owner); /* Remove current ownership */ - BLI_ghash_remove(bvh->bm_vert_to_node, v, NULL, NULL); + // BLI_ghash_remove(bvh->bm_vert_to_node, v, NULL, NULL); // assign handles below BLI_ghash_remove(current_owner->bm_unique_verts, v, NULL, NULL); /* Set new ownership */ - BLI_ghash_insert(bvh->bm_vert_to_node, v, - SET_INT_IN_POINTER(new_owner - bvh->nodes)); + BLI_ghash_assign(bvh->bm_vert_to_node, v, + SET_INT_IN_POINTER(new_owner - bvh->nodes), NULL, NULL); BLI_ghash_insert(new_owner->bm_unique_verts, v, NULL); BLI_ghash_remove(new_owner->bm_other_verts, v, NULL, NULL); BLI_assert(!BLI_ghash_haskey(new_owner->bm_other_verts, v)); |