summaryrefslogtreecommitdiffstats
path: root/libshiboken/conversions.h
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2010-03-17 14:12:00 -0300
committerHugo Lima <hugo.lima@openbossa.org>2010-03-18 19:45:08 -0300
commit75ce5d993f212581ba2fb1e623fed2c585f1c216 (patch)
tree4e1183d5703021bd1eb60c42685095b17b34018c /libshiboken/conversions.h
parent1c1002df611d9f0283379a94e943c0563a9f8804 (diff)
downloadshiboken-75ce5d993f212581ba2fb1e623fed2c585f1c216.tar.gz
shiboken-75ce5d993f212581ba2fb1e623fed2c585f1c216.tar.xz
shiboken-75ce5d993f212581ba2fb1e623fed2c585f1c216.zip
Speed up conversions of lists from python to c++ if the list class
is binded by Shiboken (like QStringList).
Diffstat (limited to 'libshiboken/conversions.h')
-rw-r--r--libshiboken/conversions.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libshiboken/conversions.h b/libshiboken/conversions.h
index 97c73fd7..13e711d8 100644
--- a/libshiboken/conversions.h
+++ b/libshiboken/conversions.h
@@ -546,6 +546,9 @@ struct StdListConverter
}
static StdList toCpp(PyObject* pyobj)
{
+ if (PyObject_TypeCheck(pyobj, SbkType<StdList>()))
+ return *reinterpret_cast<StdList*>(SbkBaseWrapper_cptr(pyobj));
+
StdList result;
for (int i = 0; i < PySequence_Size(pyobj); i++) {
PyObject* pyItem = PySequence_GetItem(pyobj, i);