diff options
| author | inada-n <songofacandy@gmail.com> | 2009-12-17 15:19:18 +0900 |
|---|---|---|
| committer | inada-n <songofacandy@gmail.com> | 2009-12-17 15:19:18 +0900 |
| commit | b9f78821d423c2883ddff4d8471cc4c93d032388 (patch) | |
| tree | 52c994df26704773d8cae5a849fea169fea4e26a /python/msgpack/unpack.h | |
| parent | f4c5b15cc6cf972695bb2281714f5b13b299fbd3 (diff) | |
| download | msgpack-python-b9f78821d423c2883ddff4d8471cc4c93d032388.tar.gz | |
Make tuple default.
Diffstat (limited to 'python/msgpack/unpack.h')
| -rw-r--r-- | python/msgpack/unpack.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/python/msgpack/unpack.h b/python/msgpack/unpack.h index 0bf2568..61a3786 100644 --- a/python/msgpack/unpack.h +++ b/python/msgpack/unpack.h @@ -20,7 +20,7 @@ #include "unpack_define.h" typedef struct unpack_user { - int use_tuple; + int use_list; } unpack_user; @@ -136,7 +136,7 @@ static inline int template_callback_false(unpack_user* u, msgpack_unpack_object* static inline int template_callback_array(unpack_user* u, unsigned int n, msgpack_unpack_object* o) { - PyObject *p = u->use_tuple ? PyTuple_New(n) : PyList_New(n); + PyObject *p = u->use_list ? PyList_New(n) : PyTuple_New(n); if (!p) return -1; @@ -146,12 +146,10 @@ static inline int template_callback_array(unpack_user* u, unsigned int n, msgpac static inline int template_callback_array_item(unpack_user* u, unsigned int current, msgpack_unpack_object* c, msgpack_unpack_object o) { - if (u->use_tuple) { - PyTuple_SET_ITEM(*c, current, o); - } - else { + if (u->use_list) PyList_SET_ITEM(*c, current, o); - } + else + PyTuple_SET_ITEM(*c, current, o); return 0; } |
