Browse Source

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.
pull/9/head
George Vlahavas 8 years ago
parent
commit
ca4ad660bc
  1. 20
      src/xdgmenumaker

20
src/xdgmenumaker

@ -283,8 +283,7 @@ def icon_max_size(icon):
return None return None
if img.size[0] <= iconsize: if img.size[0] <= iconsize:
return icon return icon
else: return None
return None
def icon_full_path(icon): def icon_full_path(icon):
@ -299,15 +298,14 @@ def icon_full_path(icon):
return icon_max_size(icon) return icon_max_size(icon)
else: else:
return icon return icon
else: icon = icon_strip(icon)
icon = icon_strip(icon) icon_theme = gtk.icon_theme_get_default()
icon_theme = gtk.icon_theme_get_default() icon = icon_theme.lookup_icon(icon, iconsize, gtk.ICON_LOOKUP_NO_SVG)
icon = icon_theme.lookup_icon(icon, iconsize, gtk.ICON_LOOKUP_NO_SVG) if icon:
if icon: icon = icon.get_filename()
icon = icon.get_filename() if max_icon_size:
if max_icon_size: icon = icon_max_size(icon)
icon = icon_max_size(icon) return icon
return icon
def get_entry_info(desktopfile, ico_paths=True): def get_entry_info(desktopfile, ico_paths=True):

Loading…
Cancel
Save