]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/utils/json_writer.py
reintroduce cutoffs when searching for very frequent words
[nominatim.git] / nominatim / utils / json_writer.py
index bb642233e78d8c4234afb7e3bc54c4cd0f69cd8b..fcc355d5eee9fa2331ad47e47eb2a4ac18dac078 100644 (file)
@@ -76,8 +76,8 @@ class JsonWriter:
     def end_array(self) -> 'JsonWriter':
         """ Write the closing bracket of a JSON array.
         """
     def end_array(self) -> 'JsonWriter':
         """ Write the closing bracket of a JSON array.
         """
-        assert self.pending in (',', '[', '')
-        if self.pending == '[':
+        assert self.pending in (',', '[', ']', ')', '')
+        if self.pending not in (',', ''):
             self.data.write(self.pending)
         self.pending = ']'
         return self
             self.data.write(self.pending)
         self.pending = ']'
         return self