diff options
author | INADA Naoki <songofacandy@gmail.com> | 2012-03-08 16:59:08 +0900 |
---|---|---|
committer | INADA Naoki <songofacandy@gmail.com> | 2012-03-08 16:59:08 +0900 |
commit | 64bdf6bcd633b4404cb5413f37a1c7ae428f048c (patch) | |
tree | c61f2eb4009dfcae8f1381cd4fe014f710dd5e2b | |
parent | 3a472b1624479ec6a196ac654137dbadc14761a9 (diff) | |
download | msgpack-python-64bdf6bcd633b4404cb5413f37a1c7ae428f048c.tar.gz |
small optimization.
-rw-r--r-- | msgpack/_msgpack.pyx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/msgpack/_msgpack.pyx b/msgpack/_msgpack.pyx index 7f369a8..612dd0f 100644 --- a/msgpack/_msgpack.pyx +++ b/msgpack/_msgpack.pyx @@ -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: |