hints: Remove superfluous variable 27/325427/1
authorSeunghun Lee <shiin.lee@samsung.com>
Mon, 9 Jun 2025 02:20:18 +0000 (11:20 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Tue, 10 Jun 2025 09:08:59 +0000 (18:08 +0900)
The found and res flags are not necessary.

Change-Id: I27413cd1081716a433e2c95d0a90dbd2440f18d5

src/bin/windowmgr/e_hints.c

index 4ed85f6e32a799001756676f41f1c5f75dd6c89b..1a5874fa04d62407d06da45fd1d720fa594c185f 100644 (file)
@@ -321,7 +321,6 @@ e_aux_hint_surface_hint_add(E_Aux_Hint_Surface *surface, int32_t id, const char
 {
    E_Comp_Wl_Aux_Hint *hint;
    Eina_List *l;
-   bool found = false;
 
    EINA_LIST_FOREACH(surface->hints, l, hint)
      {
@@ -357,28 +356,25 @@ e_aux_hint_surface_hint_add(E_Aux_Hint_Surface *surface, int32_t id, const char
                   hint->deleted = false;
                   surface->changed = true;
                }
-             found = true;
-             break;
+             goto end;
           }
      }
 
-   if (!found)
-     {
-        hint = E_NEW(E_Comp_Wl_Aux_Hint, 1);
-        EINA_SAFETY_ON_NULL_RETURN_VAL(hint, false);
-
-        memset(hint, 0, sizeof(E_Comp_Wl_Aux_Hint));
-
-        hint->id = id;
-        hint->hint = eina_stringshare_add(name);
-        hint->val = eina_stringshare_add(value);
-        hint->changed = true;
-        hint->deleted = false;
-        surface->hints = eina_list_append(surface->hints, hint);
-        surface->changed = 1;
-        ELOGF("HINTS", "AUX_HINT |Add [%d:%s:%s]", surface->ec, id, hint->hint, hint->val);
-     }
+   hint = E_NEW(E_Comp_Wl_Aux_Hint, 1);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(hint, false);
 
+   memset(hint, 0, sizeof(E_Comp_Wl_Aux_Hint));
+
+   hint->id = id;
+   hint->hint = eina_stringshare_add(name);
+   hint->val = eina_stringshare_add(value);
+   hint->changed = true;
+   hint->deleted = false;
+   surface->hints = eina_list_append(surface->hints, hint);
+   surface->changed = 1;
+   ELOGF("HINTS", "AUX_HINT |Add [%d:%s:%s]", surface->ec, id, hint->hint, hint->val);
+
+end:
    return true;
 }
 
@@ -387,7 +383,6 @@ e_aux_hint_surface_hint_change(E_Aux_Hint_Surface *surface, int32_t id, const ch
 {
    E_Comp_Wl_Aux_Hint *hint;
    Eina_List *l;
-   bool found = false;
 
    EINA_LIST_FOREACH(surface->hints, l, hint)
      {
@@ -406,14 +401,10 @@ e_aux_hint_surface_hint_change(E_Aux_Hint_Surface *surface, int32_t id, const ch
              if (hint->deleted)
                hint->deleted = false;
 
-             found = true;
-             break;
+             return true;
           }
      }
 
-   if (found)
-     return true;
-
    return false;
 }
 
@@ -422,7 +413,6 @@ e_aux_hint_surface_hint_del(E_Aux_Hint_Surface *surface, int32_t id)
 {
    E_Comp_Wl_Aux_Hint *hint;
    Eina_List *l, *ll;
-   int res = -1;
 
    EINA_LIST_FOREACH_SAFE(surface->hints, l, ll, hint)
      {
@@ -432,15 +422,11 @@ e_aux_hint_surface_hint_del(E_Aux_Hint_Surface *surface, int32_t id)
              hint->changed = true;
              hint->deleted = true;
              surface->changed = true;
-             res = hint->id;
-             break;
+             return true;
           }
      }
 
-   if (res == -1)
-     return false;
-
-   return true;
+   return false;
 }
 
 EINTERN void