some performance improvements
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5982 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
0b945f2dd3
commit
b2ede29b59
2 changed files with 8 additions and 12 deletions
|
|
@ -268,7 +268,7 @@ SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags)
|
|||
goto type_error;
|
||||
}
|
||||
}
|
||||
c = PyString_AsString(obj);
|
||||
c = PyString_AS_STRING(obj);
|
||||
/* Pointer values must start with leading underscore */
|
||||
if (*c != '_') {
|
||||
*ptr = (void *) 0;
|
||||
|
|
@ -296,9 +296,7 @@ cobject:
|
|||
}
|
||||
|
||||
if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) {
|
||||
PyObject *zero = PyInt_FromLong(0);
|
||||
PyObject_SetAttrString(pyobj,(char*)"thisown",zero);
|
||||
Py_DECREF(zero);
|
||||
PyObject_SetAttrString(pyobj,(char*)"thisown",Py_False);
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
|
@ -331,7 +329,7 @@ SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, int sz, swig_type_info *ty,
|
|||
char *c = 0;
|
||||
|
||||
if ((!obj) || (!PyString_Check(obj))) goto type_error;
|
||||
c = PyString_AsString(obj);
|
||||
c = PyString_AS_STRING(obj);
|
||||
/* Pointer values must start with leading underscore */
|
||||
if (*c != '_') goto type_error;
|
||||
c++;
|
||||
|
|
@ -385,9 +383,7 @@ SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) {
|
|||
Py_DECREF(args);
|
||||
if (inst) {
|
||||
if (own) {
|
||||
PyObject *n = PyInt_FromLong(1);
|
||||
PyObject_SetAttrString(inst,(char*)"thisown",n);
|
||||
Py_DECREF(n);
|
||||
PyObject_SetAttrString(inst,(char*)"thisown",Py_True);
|
||||
}
|
||||
robj = inst;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue