efl ui win - quieten coverity complaint about dead code

the count ?: 1 check is pointless as count is already checked above.
make it clearer that it's > 0 and remove the ? check. silence for
coverity CID 1380542
This commit is contained in:
Carsten Haitzler 2017-09-28 12:17:44 +09:00
parent 35b65e0643
commit 49df80aa6f
1 changed files with 10 additions and 10 deletions

View File

@ -8335,21 +8335,21 @@ EAPI void
elm_win_available_profiles_set(Elm_Win *obj, const char **profiles, unsigned int count)
{
if (!efl_isa(obj, MY_CLASS)) return;
if (count && profiles)
if ((count > 0) && (profiles))
{
Eina_Array *ar;
unsigned int i;
ar = eina_array_new(count ?: 1);
for (i = 0; i < count; i++)
eina_array_push(ar, profiles[i]);
efl_ui_win_wm_available_profiles_set(obj, ar);
eina_array_free(ar);
}
else
{
efl_ui_win_wm_available_profiles_set(obj, NULL);
ar = eina_array_new(count);
if (ar)
{
for (i = 0; i < count; i++)
eina_array_push(ar, profiles[i]);
efl_ui_win_wm_available_profiles_set(obj, ar);
eina_array_free(ar);
}
}
else efl_ui_win_wm_available_profiles_set(obj, NULL);
}
// deprecated