(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

@ -100,9 +100,14 @@ static void ozone_draw_entry_value(
else
{
if (!string_is_empty(entry->value))
{
if (string_is_equal(entry->value, "..."))
return;
if (string_starts_with(entry->value, "(") &&
string_ends_with (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)") ||
@ -116,13 +121,10 @@ static void ozone_draw_entry_value(
string_is_equal(entry->value, "(FILE)") ||
string_is_equal(entry->value, "(IMAGE)")
)
{
return;
}
else
do_draw_text = true;
}
else
do_draw_text = true;
}

View File

@ -3081,9 +3081,16 @@ static int xmb_draw_item(
else
{
if (!string_is_empty(entry.value))
{
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, "...") ||
string_is_equal(entry.value, "(PRESET)") ||
string_is_equal(entry.value, "(SHADER)") ||
string_is_equal(entry.value, "(COMP)") ||
@ -3097,9 +3104,10 @@ static int xmb_draw_item(
string_is_equal(entry.value, "(FILE)") ||
string_is_equal(entry.value, "(IMAGE)")
)
{
found = true;
}
else
if (!found)
do_draw_text = true;
}
else