mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +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] = {}
|
categories: Dict[Tuple[str, str], float] = {}
|
||||||
min_penalty = 1000.0
|
min_penalty = 1000.0
|
||||||
for t in tokens:
|
for t in tokens:
|
||||||
if t.penalty < min_penalty:
|
min_penalty = min(min_penalty, t.penalty)
|
||||||
min_penalty = t.penalty
|
|
||||||
cat = t.get_category()
|
cat = t.get_category()
|
||||||
if t.penalty < categories.get(cat, 1000.0):
|
if t.penalty < categories.get(cat, 1000.0):
|
||||||
categories[cat] = t.penalty
|
categories[cat] = t.penalty
|
||||||
|
|||||||
Reference in New Issue
Block a user