mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 10:27:57 +00:00
prefer min() function over if construct
Fixes a linter complaint.
This commit is contained in:
@@ -199,8 +199,7 @@ class SearchData:
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user