Skip to content

Commit

Permalink
perf: Use operator module instead of lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Dec 22, 2024
1 parent 03b7347 commit e5df6e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion extension_explorer/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from collections import defaultdict
from copy import deepcopy
from functools import lru_cache
from operator import itemgetter

import json_merge_patch
import jsonpointer
Expand Down Expand Up @@ -106,7 +107,7 @@ def get_present_and_historical_versions(extension):
versions = extension['versions']

historical_versions = [v for v in versions.values() if v['version'] != latest_version]
historical_versions = sorted(historical_versions, key=lambda v: v['date'], reverse=True)
historical_versions = sorted(historical_versions, key=itemgetter('date'), reverse=True)
historical_versions = [(v['version'], v['date']) for v in historical_versions]

present_versions = [(latest_version, versions[latest_version]['date'] or gettext('latest'))]
Expand Down

0 comments on commit e5df6e6

Please sign in to comment.