Skip to content

Commit

Permalink
simplify accents construction: used set is unless with sorted
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpoelen committed Sep 9, 2024
1 parent a4dc7ac commit 3b2bced
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/gen_reversed_keylayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ def push_keys(scancodes_by_mods):
accents = dict()
push_ref = lambda scancodes_by_mods: \
accents.setdefault(
''.join(\
f"0x{mod_flags:x}: {sorted(set(x for x in ''.join(scancodes).split(', ') if x))[0]}, " \
''.join(
f"0x{mod_flags:x}: {sorted(x for x in ''.join(scancodes).split(', ') if x)[0]}, "
for mod_flags, scancodes in scancodes_by_mods.items()),
len(accents)
)
Expand Down

0 comments on commit 3b2bced

Please sign in to comment.