From 6d277de62ba97e6990e0718d07ffbe82ae2c0efb Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 15 Jul 2016 21:45:07 +0200 Subject: [PATCH] Simplifications --- menu/menu_displaylist.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 389c47ccad..d6327acdc7 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -3169,15 +3169,11 @@ static int menu_displaylist_parse_playlists( if (list_size == 0) { - if (!horizontal) - menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_ITEMS), - msg_hash_to_str(MENU_ENUM_LABEL_NO_ITEMS), - MENU_ENUM_LABEL_NO_ITEMS, - MENU_SETTING_NO_ITEM, 0, 0); - string_list_free(str_list); + if (!horizontal) + goto no_playlists; + return 0; } @@ -3217,15 +3213,17 @@ static int menu_displaylist_parse_playlists( string_list_free(str_list); if (items_found == 0) - { - menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_ITEMS), - msg_hash_to_str(MENU_ENUM_LABEL_NO_ITEMS), - MENU_ENUM_LABEL_NO_ITEMS, - MENU_SETTING_NO_ITEM, 0, 0); - } + goto no_playlists; return 0; + +no_playlists: + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_ITEMS), + msg_hash_to_str(MENU_ENUM_LABEL_NO_ITEMS), + MENU_ENUM_LABEL_NO_ITEMS, + MENU_SETTING_NO_ITEM, 0, 0); + return 0; } static int menu_displaylist_parse_generic(