diff options
author | Andrew Rogers <andrew.rogers@wdc.com> | 2018-11-27 23:30:51 +0000 |
---|---|---|
committer | Andrew Rogers <andrew.rogers@wdc.com> | 2018-11-27 23:30:51 +0000 |
commit | 0fecd1538faa45b5818776b676be41aca7780c25 (patch) | |
tree | e8d7ff910b3e4ad5ec9386b4eb8c9f97762c7c38 /Lib/python | |
parent | 3c090307a48b0c6a1f034357b751bc9469cc111f (diff) | |
download | swig-0fecd1538faa45b5818776b676be41aca7780c25.tar.gz |
Cleanup accessing/decref of globals, to avoid code bloat in init function.
Diffstat (limited to 'Lib/python')
-rw-r--r-- | Lib/python/pyinit.swg | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/python/pyinit.swg b/Lib/python/pyinit.swg index c155185cd..d8f3bf444 100644 --- a/Lib/python/pyinit.swg +++ b/Lib/python/pyinit.swg @@ -227,11 +227,7 @@ SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void SWIGINTERN PyObject * SWIG_globals(void) { static PyObject *_SWIG_globals = 0; - if (!_SWIG_globals) { - _SWIG_globals = SWIG_newvarlink(); - } else { - Py_INCREF(_SWIG_globals); - } + if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); return _SWIG_globals; } |