mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-10-28 08:04:12 +00:00
small optimization.
This commit is contained in:
parent
3a472b1624
commit
64bdf6bcd6
1 changed files with 2 additions and 2 deletions
|
|
@ -131,7 +131,7 @@ cdef class Packer(object):
|
|||
d = o
|
||||
ret = msgpack_pack_map(&self.pk, len(d))
|
||||
if ret == 0:
|
||||
for k,v in d.items():
|
||||
for k,v in d.iteritems():
|
||||
ret = self._pack(k, nest_limit-1)
|
||||
if ret != 0: break
|
||||
ret = self._pack(v, nest_limit-1)
|
||||
|
|
@ -149,7 +149,7 @@ cdef class Packer(object):
|
|||
raise TypeError("can't serialize %r" % (o,))
|
||||
return ret
|
||||
|
||||
def pack(self, object obj):
|
||||
cpdef pack(self, object obj):
|
||||
cdef int ret
|
||||
ret = self._pack(obj, DEFAULT_RECURSE_LIMIT)
|
||||
if ret:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue