From dfdb810099017ae3468ee8db9d3a3da2e21be250 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Fri, 11 Apr 2014 00:40:21 +0300 Subject: [PATCH] This is actually better without the count check. --- lib/menu.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/menu.c b/lib/menu.c index cb0d3ee..edbcf73 100644 --- a/lib/menu.c +++ b/lib/menu.c @@ -488,12 +488,10 @@ void bmMenuFilter(bmMenu *menu) _bmItemListSetItemsNoCopy(&menu->filtered, filtered, count); menu->index = selected; - if (count) { - if (menu->oldFilter) - free(menu->oldFilter); + if (menu->oldFilter) + free(menu->oldFilter); - menu->oldFilter = _bmStrdup(menu->filter); - } + menu->oldFilter = _bmStrdup(menu->filter); } /**