summaryrefslogtreecommitdiff
path: root/python/msgpack/unpack.h
diff options
context:
space:
mode:
authorinada-n <songofacandy@gmail.com>2009-12-17 15:19:18 +0900
committerinada-n <songofacandy@gmail.com>2009-12-17 15:19:18 +0900
commitb9f78821d423c2883ddff4d8471cc4c93d032388 (patch)
tree52c994df26704773d8cae5a849fea169fea4e26a /python/msgpack/unpack.h
parentf4c5b15cc6cf972695bb2281714f5b13b299fbd3 (diff)
downloadmsgpack-python-b9f78821d423c2883ddff4d8471cc4c93d032388.tar.gz
Make tuple default.
Diffstat (limited to 'python/msgpack/unpack.h')
-rw-r--r--python/msgpack/unpack.h12
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;
}