Clenaup: odd use of ternary operators
authorCampbell Barton <ideasman42@gmail.com>
Tue, 16 Apr 2019 10:09:34 +0000 (12:09 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 16 Apr 2019 10:09:34 +0000 (12:09 +0200)
source/blender/editors/interface/interface.c
source/blender/editors/sculpt_paint/paint_cursor.c

index 098a1e7..b76be4c 100644 (file)
@@ -1706,7 +1706,7 @@ int ui_but_is_pushed_ex(uiBut *but, double *value)
        int is_push = 0;
 
        if (but->bit) {
-               const bool state = ELEM(but->type, UI_BTYPE_TOGGLE_N, UI_BTYPE_ICON_TOGGLE_N, UI_BTYPE_CHECKBOX_N) ? false : true;
+               const bool state = !ELEM(but->type, UI_BTYPE_TOGGLE_N, UI_BTYPE_ICON_TOGGLE_N, UI_BTYPE_CHECKBOX_N);
                int lvalue;
                UI_GET_BUT_VALUE_INIT(but, *value);
                lvalue = (int)*value;
index 4d1dd7e..4b714e0 100644 (file)
@@ -798,7 +798,7 @@ static void paint_draw_alpha_overlay(
 {
        /* Color means that primary brush texture is colored and
         * secondary is used for alpha/mask control. */
-       bool col = ELEM(mode, PAINT_MODE_TEXTURE_3D, PAINT_MODE_TEXTURE_2D, PAINT_MODE_VERTEX) ? true : false;
+       bool col = ELEM(mode, PAINT_MODE_TEXTURE_3D, PAINT_MODE_TEXTURE_2D, PAINT_MODE_VERTEX);
        eOverlayControlFlags flags = BKE_paint_get_overlay_flags();
        gpuPushAttr(GPU_DEPTH_BUFFER_BIT | GPU_BLEND_BIT);