From 392bcfd98b5ac162b25e61a159193fc598e80163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Sat, 8 Oct 2016 11:28:25 -0300 Subject: [PATCH] (material) Reduce CPU usage in big lists by 3 The program spent more time clearing rich_label and entry_value than fetching it's value from the menu system and rendering it on the screen. --- menu/drivers/materialui.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index 91bea9f9c3..a8e0c4a65b 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -662,10 +662,12 @@ static void mui_render_menu_list(mui_handle_t *mui, { int y; size_t selection; - char rich_label[PATH_MAX_LENGTH] = {0}; - char entry_value[PATH_MAX_LENGTH] = {0}; + char rich_label[PATH_MAX_LENGTH]; + char entry_value[PATH_MAX_LENGTH]; bool entry_selected = false; + rich_label[0] = entry_value[0] = '\0'; + if (!menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection)) continue;