summaryrefslogtreecommitdiff
path: root/menuconfig.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-10-15 12:20:03 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2018-10-15 12:25:49 +0200
commit796a3459776856c30f73d166b251898cdd4cd375 (patch)
tree9c8387b5ff45348c6aa7570e1590bd04305a4506 /menuconfig.py
parent10d412e43fb5233b9e0105d79e3a53c2fdee4446 (diff)
menuconfig: Simplify _sorted_menu_comment_nodes()
Can use the same function for both sort keys, and the logic can be simplified a bit too. The += is deliberate, to do in-place modification.
Diffstat (limited to 'menuconfig.py')
-rwxr-xr-xmenuconfig.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/menuconfig.py b/menuconfig.py
index fadf38a..accaf6f 100755
--- a/menuconfig.py
+++ b/menuconfig.py
@@ -2021,10 +2021,11 @@ def _sorted_menu_comment_nodes(cached_nodes=[]):
# with the menus first
if not cached_nodes:
- cached_nodes += sorted(_kconf.menus,
- key=lambda menu: menu.prompt[0])
- cached_nodes += sorted(_kconf.comments,
- key=lambda comment: comment.prompt[0])
+ def prompt_text(mc):
+ return mc.prompt[0]
+
+ cached_nodes += sorted(_kconf.menus, key=prompt_text) + \
+ sorted(_kconf.comments, key=prompt_text)
return cached_nodes