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 da8b341 commit 73cb206
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from collections import OrderedDict, defaultdict
from copy import deepcopy
from io import StringIO
from operator import itemgetter
from pathlib import Path

import click
Expand Down Expand Up @@ -1005,7 +1006,7 @@ def _link(name, fields, text):
if additional_fields:
click.echo(f"\nAdditional fields ({len(additional_fields)}):")
click.echo(" field,id,title")
for field, occurrences in sorted(additional_fields.items(), key=lambda item: item[1]):
for field, occurrences in sorted(additional_fields.items(), key=itemgetter(1)):
click.echo(f" {field}{''.join(f',{identifier},{title}' for identifier, title in occurrences)}")

if missing_data:
Expand Down

0 comments on commit 73cb206

Please sign in to comment.