Skip to content

Commit 58fa57c

Browse files
committed
cleanup
1 parent 90b7c44 commit 58fa57c

File tree

1 file changed

+1
-4
lines changed
  • bindings/python/pymongoarrow

1 file changed

+1
-4
lines changed

bindings/python/pymongoarrow/lib.pyx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,6 @@ cdef class BuilderManager:
196196
if parent_type == BSON_TYPE_ARRAY:
197197
(<ListBuilder>self.builder_map[base_key]).append_count()
198198

199-
# Update our count for top level documents.
200-
if parent_type == 0:
201-
self.count += 1
202-
203199
cpdef void process_bson_stream(self, const uint8_t* bson_stream, size_t length):
204200
"""Process a bson byte stream."""
205201
cdef bson_reader_t* stream_reader = bson_reader_new_from_data(bson_stream, length)
@@ -213,6 +209,7 @@ cdef class BuilderManager:
213209
if not bson_iter_init(&doc_iter, doc):
214210
raise InvalidBSON("Could not read BSON document")
215211
self.parse_document(&doc_iter, b"", 0)
212+
self.count += 1
216213
finally:
217214
bson_reader_destroy(stream_reader)
218215

0 commit comments

Comments
 (0)