Cut down on one additional strlen call

This commit is contained in:
libretroadmin 2023-08-16 16:07:53 +02:00
parent e407d9a7b2
commit 1b128c61d6

View File

@ -11000,6 +11000,7 @@ static void materialui_list_insert(
/* Playlist manager icons */ /* Playlist manager icons */
else if (string_is_equal(fullpath, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLIST_MANAGER_LIST))) else if (string_is_equal(fullpath, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLIST_MANAGER_LIST)))
{ {
size_t path_siz = strlen(path);
/* Set defaults */ /* Set defaults */
node->icon_texture_index = MUI_TEXTURE_PLAYLIST; node->icon_texture_index = MUI_TEXTURE_PLAYLIST;
node->icon_type = MUI_ICON_TYPE_INTERNAL; node->icon_type = MUI_ICON_TYPE_INTERNAL;
@ -11007,13 +11008,13 @@ static void materialui_list_insert(
&& !string_is_empty(path)) && !string_is_empty(path))
{ {
if (string_ends_with_size(path, "_history.lpl", if (string_ends_with_size(path, "_history.lpl",
strlen(path), STRLEN_CONST("_history.lpl"))) path_siz, STRLEN_CONST("_history.lpl")))
{ {
node->icon_texture_index = MUI_TEXTURE_HISTORY; node->icon_texture_index = MUI_TEXTURE_HISTORY;
node->icon_type = MUI_ICON_TYPE_INTERNAL; node->icon_type = MUI_ICON_TYPE_INTERNAL;
} }
else if (string_ends_with_size(path, "_favorites.lpl", else if (string_ends_with_size(path, "_favorites.lpl",
strlen(path), STRLEN_CONST("_favorites.lpl"))) path_siz, STRLEN_CONST("_favorites.lpl")))
{ {
node->icon_texture_index = MUI_TEXTURE_ADD_TO_FAVORITES; node->icon_texture_index = MUI_TEXTURE_ADD_TO_FAVORITES;
node->icon_type = MUI_ICON_TYPE_INTERNAL; node->icon_type = MUI_ICON_TYPE_INTERNAL;