Skip to content

Commit

Permalink
prefer min() function over if construct
Browse files Browse the repository at this point in the history
Fixes a linter complaint.
  • Loading branch information
lonvia committed Feb 27, 2024
1 parent 918fec7 commit dc1baaa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions nominatim/api/search/db_search_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ def set_qualifiers(self, tokens: List[Token]) -> None:
categories: Dict[Tuple[str, str], float] = {}
min_penalty = 1000.0
for t in tokens:
if t.penalty < min_penalty:
min_penalty = t.penalty
min_penalty = min(min_penalty, t.penalty)
cat = t.get_category()
if t.penalty < categories.get(cat, 1000.0):
categories[cat] = t.penalty
Expand Down

0 comments on commit dc1baaa

Please sign in to comment.