penguin-wwy commented on code in PR #1942:
URL: https://github.com/apache/fury/pull/1942#discussion_r1841685635


##########
python/pyfury/_serialization.pyx:
##########
@@ -1644,29 +1656,143 @@ cdef class CollectionSerializer(Serializer):
     cpdef int16_t get_xtype_id(self):
         return -FuryType.LIST.value
 
+    cpdef int8_t write_header(self, Buffer buffer, value):
+        cdef int8_t collect_flag = COLLECTION_DEFAULT_FLAG
+        elem_type = type(next(iter(value)))

Review Comment:
   This is to extract the type of the first element and avoid checking 
`elem_type is None` in the loop. Since the collection might be a set, an 
iterator retrieves it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to