Skip to contentSkip to conversation

support/scripts/pkg-stats: get_config_packages(): use dict.values()

PATCH New Peter Korsgaard 1 participant 2 messages Feb 1, 2021 – Feb 2, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 support/scripts/pkg-stats: get_config_packages(): use dict.values()

There is no need to get both the key and the value out of the dict if the key is not used, so use dict.values() instead.

---
 support/scripts/pkg-stats | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
support/scripts/pkg-stats +1 -1
index f58afc02ae..ac490a8d8f 100755
@@ -358,7 +358,7 @@ def get_pkglist(npackages, package_list):
 def get_config_packages():
     cmd = ["make", "--no-print-directory", "show-info"]
     js = json.loads(subprocess.check_output(cmd))
-    return set([v["name"] for _, v in js.items()])
+    return set([v["name"] for v in js.values()])
 
 
 def package_init_make_info():
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 support/scripts/pkg-stats: get_config_packages(): use dict.values()

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Korsgaard <[email protected]> writes:

There is no need to get both the key and the value out of the dict if the key is not used, so use dict.values() instead.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard