]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/api/search/query.py
replace CASE construct with plpgsql function
[nominatim.git] / nominatim / api / search / query.py
index 2ba49bbe514fc56bba00892f02b78a84555d9f34..f2b18f873a8121fbdac79ea3c67b682826316e6b 100644 (file)
@@ -169,7 +169,10 @@ class QueryNode:
             and ending at the node 'end'. Returns 'None' if no such
             tokens exist.
         """
-        return next((t.tokens for t in self.starting if t.end == end and t.ttype == ttype), None)
+        for tlist in self.starting:
+            if tlist.end == end and tlist.ttype == ttype:
+                return tlist.tokens
+        return None
 
 
 @dataclasses.dataclass