]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/api/search/db_search_fields.py
Merge pull request #3347 from lonvia/tweak-boundary-imports
[nominatim.git] / nominatim / api / search / db_search_fields.py
index 6947a565f80dad421dcd9398975284988121a254..846e1ce28dc4589969d0c25942fbb025741daa73 100644 (file)
@@ -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