Simplify sorting

Calling sort_key explicitly is marginally faster, but less readable.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2020-03-26 22:41:32 +01:00
parent 28af958ea4
commit 7fa3eb7d44

View file

@ -400,7 +400,7 @@ def list_files_to_merge(options):
"Oldest" is defined by `EntryFileSortKey`.
"""
files_to_merge = glob.glob(os.path.join(options.dir, '*.md'))
files_to_merge.sort(key=lambda f: EntryFileSortKey(f).sort_key())
files_to_merge.sort(key=EntryFileSortKey)
return files_to_merge
def merge_entries(options):