(Ozone/XMB) Optimize some string_is_equal comparisons

This commit is contained in:
twinaphex 2020-06-08 07:19:19 +02:00
parent 58b22b0a6e
commit 5db62e73da
2 changed files with 44 additions and 34 deletions

View File

@ -101,29 +101,31 @@ static void ozone_draw_entry_value(
{
if (!string_is_empty(entry->value))
{
if (
string_is_equal(entry->value, "...") ||
string_is_equal(entry->value, "(PRESET)") ||
string_is_equal(entry->value, "(SHADER)") ||
string_is_equal(entry->value, "(COMP)") ||
string_is_equal(entry->value, "(CORE)") ||
string_is_equal(entry->value, "(MOVIE)") ||
string_is_equal(entry->value, "(MUSIC)") ||
string_is_equal(entry->value, "(DIR)") ||
string_is_equal(entry->value, "(RDB)") ||
string_is_equal(entry->value, "(CURSOR)")||
string_is_equal(entry->value, "(CFILE)") ||
string_is_equal(entry->value, "(FILE)") ||
string_is_equal(entry->value, "(IMAGE)")
if (string_is_equal(entry->value, "..."))
return;
if (string_starts_with(entry->value, "(") &&
string_ends_with (entry->value, ")")
)
{
return;
if (
string_is_equal(entry->value, "(PRESET)") ||
string_is_equal(entry->value, "(SHADER)") ||
string_is_equal(entry->value, "(COMP)") ||
string_is_equal(entry->value, "(CORE)") ||
string_is_equal(entry->value, "(MOVIE)") ||
string_is_equal(entry->value, "(MUSIC)") ||
string_is_equal(entry->value, "(DIR)") ||
string_is_equal(entry->value, "(RDB)") ||
string_is_equal(entry->value, "(CURSOR)")||
string_is_equal(entry->value, "(CFILE)") ||
string_is_equal(entry->value, "(FILE)") ||
string_is_equal(entry->value, "(IMAGE)")
)
return;
}
else
do_draw_text = true;
}
else
do_draw_text = true;
do_draw_text = true;
}
if (do_draw_text)

View File

@ -3082,24 +3082,32 @@ static int xmb_draw_item(
{
if (!string_is_empty(entry.value))
{
if (
string_is_equal(entry.value, "...") ||
string_is_equal(entry.value, "(PRESET)") ||
string_is_equal(entry.value, "(SHADER)") ||
string_is_equal(entry.value, "(COMP)") ||
string_is_equal(entry.value, "(CORE)") ||
string_is_equal(entry.value, "(MOVIE)") ||
string_is_equal(entry.value, "(MUSIC)") ||
string_is_equal(entry.value, "(DIR)") ||
string_is_equal(entry.value, "(RDB)") ||
string_is_equal(entry.value, "(CURSOR)")||
string_is_equal(entry.value, "(CFILE)") ||
string_is_equal(entry.value, "(FILE)") ||
string_is_equal(entry.value, "(IMAGE)")
bool found = false;
if (string_is_equal(entry.value, "..."))
found = true;
else if (string_starts_with(entry.value, "(") &&
string_ends_with (entry.value, ")")
)
{
if (
string_is_equal(entry.value, "(PRESET)") ||
string_is_equal(entry.value, "(SHADER)") ||
string_is_equal(entry.value, "(COMP)") ||
string_is_equal(entry.value, "(CORE)") ||
string_is_equal(entry.value, "(MOVIE)") ||
string_is_equal(entry.value, "(MUSIC)") ||
string_is_equal(entry.value, "(DIR)") ||
string_is_equal(entry.value, "(RDB)") ||
string_is_equal(entry.value, "(CURSOR)")||
string_is_equal(entry.value, "(CFILE)") ||
string_is_equal(entry.value, "(FILE)") ||
string_is_equal(entry.value, "(IMAGE)")
)
found = true;
}
else
if (!found)
do_draw_text = true;
}
else