mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
action_select_default optimization
This commit is contained in:
parent
b2124a1f89
commit
0010bffb63
@ -34,24 +34,15 @@
|
||||
#define BIND_ACTION_SELECT(cbs, name) (cbs)->action_select = (name)
|
||||
#endif
|
||||
|
||||
static int action_select_default(const char *path, const char *label, unsigned type,
|
||||
static int action_select_default(
|
||||
const char *path, const char *label, unsigned type,
|
||||
size_t idx, size_t entry_idx)
|
||||
{
|
||||
menu_entry_t entry;
|
||||
int ret = 0;
|
||||
enum menu_action action = MENU_ACTION_NOOP;
|
||||
menu_file_list_cbs_t *cbs = NULL;
|
||||
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
|
||||
|
||||
menu_entry_init(&entry);
|
||||
/* Note: If menu_entry_action() is modified,
|
||||
* will have to verify that these parameters
|
||||
* remain unused... */
|
||||
entry.rich_label_enabled = false;
|
||||
entry.value_enabled = false;
|
||||
entry.sublabel_enabled = false;
|
||||
menu_entry_get(&entry, 0, idx, NULL, false);
|
||||
|
||||
if (selection_buf)
|
||||
cbs = (menu_file_list_cbs_t*)
|
||||
file_list_get_actiondata_at_offset(selection_buf, idx);
|
||||
@ -101,7 +92,20 @@ static int action_select_default(const char *path, const char *label, unsigned t
|
||||
}
|
||||
|
||||
if (action != MENU_ACTION_NOOP)
|
||||
ret = menu_entry_action(&entry, idx, action);
|
||||
{
|
||||
menu_entry_t entry;
|
||||
menu_entry_init(&entry);
|
||||
|
||||
/* Note: If menu_entry_action() is modified,
|
||||
* will have to verify that these parameters
|
||||
* remain unused... */
|
||||
entry.rich_label_enabled = false;
|
||||
entry.value_enabled = false;
|
||||
entry.sublabel_enabled = false;
|
||||
menu_entry_get(&entry, 0, idx, NULL, false);
|
||||
|
||||
ret = menu_entry_action(&entry, idx, action);
|
||||
}
|
||||
|
||||
task_queue_check();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user