Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/intern/polyfill2d_beautify.c')
-rw-r--r--source/blender/blenlib/intern/polyfill2d_beautify.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/polyfill2d_beautify.c b/source/blender/blenlib/intern/polyfill2d_beautify.c
index ba71f52b530..46f9251bea7 100644
--- a/source/blender/blenlib/intern/polyfill2d_beautify.c
+++ b/source/blender/blenlib/intern/polyfill2d_beautify.c
@@ -430,17 +430,19 @@ void BLI_polyfill_beautify(
}
if (!is_boundary_edge(e_pair[0], e_pair[1], coord_last)) {
- struct PolyEdge *e = BLI_edgehash_lookup(ehash, e_pair[0], e_pair[1]);
- if (e == NULL) {
+ struct PolyEdge *e;
+ void **val_p;
+
+ if (!BLI_edgehash_ensure_p(ehash, e_pair[0], e_pair[1], &val_p)) {
e = &edges[edges_tot_used++];
- BLI_edgehash_insert(ehash, e_pair[0], e_pair[1], e);
+ *val_p = e;
memcpy(e->verts, e_pair, sizeof(e->verts));
#ifndef NDEBUG
e->faces[!e_index] = (unsigned int)-1;
#endif
}
else {
-
+ e = *val_p;
/* ensure each edge only ever has 2x users */
#ifndef NDEBUG
BLI_assert(e->faces[e_index] == (unsigned int)-1);