From ca4ad660bcb187c313e1570db64fc0f58c79b97a Mon Sep 17 00:00:00 2001 From: George Vlahavas Date: Sat, 5 Nov 2016 21:06:24 +0200 Subject: [PATCH] Remove redundant branching No reason to use an else statement and branch the code since the previous if always returns and exits the function call anyway. --- src/xdgmenumaker | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/xdgmenumaker b/src/xdgmenumaker index 31ffea4..4036374 100755 --- a/src/xdgmenumaker +++ b/src/xdgmenumaker @@ -283,8 +283,7 @@ def icon_max_size(icon): return None if img.size[0] <= iconsize: return icon - else: - return None + return None def icon_full_path(icon): @@ -299,15 +298,14 @@ def icon_full_path(icon): return icon_max_size(icon) else: return icon - else: - icon = icon_strip(icon) - icon_theme = gtk.icon_theme_get_default() - icon = icon_theme.lookup_icon(icon, iconsize, gtk.ICON_LOOKUP_NO_SVG) - if icon: - icon = icon.get_filename() - if max_icon_size: - icon = icon_max_size(icon) - return icon + icon = icon_strip(icon) + icon_theme = gtk.icon_theme_get_default() + icon = icon_theme.lookup_icon(icon, iconsize, gtk.ICON_LOOKUP_NO_SVG) + if icon: + icon = icon.get_filename() + if max_icon_size: + icon = icon_max_size(icon) + return icon def get_entry_info(desktopfile, ico_paths=True):