diff options
| author | sasha <sasha@localhost> | 2006-01-18 22:05:11 +0000 |
|---|---|---|
| committer | sasha <sasha@localhost> | 2006-01-18 22:05:11 +0000 |
| commit | b38716564107fd241239c864d0ce9e68fbf82581 (patch) | |
| tree | 73e09ea2cb6a4224fe9d76935663d91bb264d769 /numpy/core/src/arrayobject.c | |
| parent | 968b9239c6b2401d6688bf86d55bbcc6a48cc3b7 (diff) | |
| download | numpy-b38716564107fd241239c864d0ce9e68fbf82581.tar.gz | |
static allocation of boolean values
Diffstat (limited to 'numpy/core/src/arrayobject.c')
| -rw-r--r-- | numpy/core/src/arrayobject.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index 0207570da..fdd2cbe2b 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -810,14 +810,8 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base) int swap; type_num = descr->type_num; - /* XXX: Extra check is needed to allow this function to - XXX: be called to initialize bool values. It would - XXX: be better not to use this function in init. */ - if (type_num == PyArray_BOOL && PyArrayScalar_True) { - int i = *(Bool*)data; - Py_INCREF(PyArrayScalar_BoolValues[i]); - return PyArrayScalar_BoolValues[i]; - } + if (type_num == PyArray_BOOL) + PyArrayScalar_RETURN_BOOL_FROM_LONG(*(Bool*)data); else if (type_num == PyArray_OBJECT) { Py_INCREF(*((PyObject **)data)); return *((PyObject **)data); |
