From dcba738541df2934200a4151d95a8c222c6d9f5d Mon Sep 17 00:00:00 2001 From: Ryan Brady Date: Tue, 3 Jun 2014 11:37:15 -0400 Subject: [PATCH] Remove uneeded code from pkg-map This patch removes a couple of lines of redundant code. In Python, the get method on a dictionary defaults the return value to None, so the method never raises a key error. https://docs.python.org/2/library/stdtypes.html#typesmapping Change-Id: I180877f9be23d373cd63771bb3682d6587ec6fac --- elements/pkg-map/bin/pkg-map | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/elements/pkg-map/bin/pkg-map b/elements/pkg-map/bin/pkg-map index 1849d511..fcae994c 100755 --- a/elements/pkg-map/bin/pkg-map +++ b/elements/pkg-map/bin/pkg-map @@ -89,9 +89,7 @@ def main(): if distro_map: name_map.update(distro_map) for name in extra: - pkg_name = None - if name in name_map: - pkg_name = name_map.get(name) + pkg_name = name_map.get(name) if pkg_name: print(pkg_name) else: