diff options
author | Julian Taylor <juliantaylor108@gmail.com> | 2014-03-05 21:59:49 +0100 |
---|---|---|
committer | Julian Taylor <juliantaylor108@gmail.com> | 2014-03-05 21:59:49 +0100 |
commit | 7571ca733d58d2eef0b8cd5f550cab2959b852a9 (patch) | |
tree | d850be4d62ccced5e5f7a34717687f1d73dedfee | |
parent | fea6079da7929aff63bf8ef59b20e7a04dafcf0c (diff) | |
parent | 18eb88b083779564250cee0fe7a77ae771f996ed (diff) | |
download | numpy-7571ca733d58d2eef0b8cd5f550cab2959b852a9.tar.gz |
Merge pull request #4447 from charris/small-optimization
MAINT: Use static variable in numpy/core/src/multiarray/descriptor.c.
-rw-r--r-- | numpy/core/src/multiarray/descriptor.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/src/multiarray/descriptor.c b/numpy/core/src/multiarray/descriptor.c index d00cb0b22..8f6582edf 100644 --- a/numpy/core/src/multiarray/descriptor.c +++ b/numpy/core/src/multiarray/descriptor.c @@ -1693,12 +1693,12 @@ arraydescr_protocol_typestr_get(PyArray_Descr *self) static PyObject * arraydescr_typename_get(PyArray_Descr *self) { - int len; + static const char np_prefix[] = "numpy."; + const int np_prefix_len = sizeof(np_prefix) - 1; PyTypeObject *typeobj = self->typeobj; PyObject *res; char *s; - const char np_prefix[] = "numpy."; - const int np_prefix_len = sizeof(np_prefix) - 1; + int len; int prefix_len; int suffix_len; |