From e1c0d18598546040b2c5f130d720d45d38639910 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 27 Jun 2022 17:20:21 +1000 Subject: [PATCH] Cleanup: remove redundant has key checks --- source/blender/editors/screen/screen_context.c | 3 +-- source/blender/editors/sculpt_paint/sculpt_expand.c | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index 11a62123ad7..fe69759481b 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -1024,9 +1024,8 @@ static eContextResult screen_ctx_sel_actions_impl(const bContext *C, } /* Add the action to the output list if not already added. */ - if (!BLI_gset_haskey(seen_set, action)) { + if (BLI_gset_add(seen_set, action)) { CTX_data_id_list_add(result, &action->id); - BLI_gset_add(seen_set, action); } } } diff --git a/source/blender/editors/sculpt_paint/sculpt_expand.c b/source/blender/editors/sculpt_paint/sculpt_expand.c index fbf988d63e8..9648f558049 100644 --- a/source/blender/editors/sculpt_paint/sculpt_expand.c +++ b/source/blender/editors/sculpt_paint/sculpt_expand.c @@ -1864,10 +1864,8 @@ static int sculpt_expand_modal(bContext *C, wmOperator *op, const wmEvent *event /* Add new Face Sets IDs to the snapping gset if enabled. */ if (expand_cache->snap) { const int active_face_set_id = sculpt_expand_active_face_set_id_get(ss, expand_cache); - if (!BLI_gset_haskey(expand_cache->snap_enabled_face_sets, - POINTER_FROM_INT(active_face_set_id))) { - BLI_gset_add(expand_cache->snap_enabled_face_sets, POINTER_FROM_INT(active_face_set_id)); - } + /* The key may exist, in that case this does nothing. */ + BLI_gset_add(expand_cache->snap_enabled_face_sets, POINTER_FROM_INT(active_face_set_id)); } /* Update the sculpt data with the current state of the #ExpandCache. */