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:
authorCampbell Barton <ideasman42@gmail.com>2013-08-17 12:00:22 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-08-17 12:00:22 +0400
commit85b0315b3bae9e699021977f9b40d504d9a9d108 (patch)
tree0777800d7d8cf2d3569493c2e4b937480fe1910b /source/blender/editors/sculpt_paint/sculpt_uv.c
parent1b11428101d390e482f6a67adba27f42cda7f4a8 (diff)
avoid double ghash lookups
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_uv.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_uv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c
index 9c73d4d9477..d630b6478fb 100644
--- a/source/blender/editors/sculpt_paint/sculpt_uv.c
+++ b/source/blender/editors/sculpt_paint/sculpt_uv.c
@@ -662,6 +662,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm
BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
int offset1, itmp1 = uv_element_offset_from_face_get(data->elementMap, efa, l, island_index, do_island_optimization);
int offset2, itmp2 = uv_element_offset_from_face_get(data->elementMap, efa, l->next, island_index, do_island_optimization);
+ char *flag;
/* Skip edge if not found(unlikely) or not on valid island */
if (itmp1 == -1 || itmp2 == -1)
@@ -682,8 +683,8 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm
edges[counter].uv2 = offset1;
}
/* Hack! Set the value of the key to its flag. Now we can set the flag when an edge exists twice :) */
- if (BLI_ghash_haskey(edgeHash, &edges[counter])) {
- char *flag = BLI_ghash_lookup(edgeHash, &edges[counter]);
+ flag = BLI_ghash_lookup(edgeHash, &edges[counter]);
+ if (flag) {
*flag = 1;
}
else {