summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Taylor <juliantaylor108@gmail.com>2014-03-05 21:59:49 +0100
committerJulian Taylor <juliantaylor108@gmail.com>2014-03-05 21:59:49 +0100
commit7571ca733d58d2eef0b8cd5f550cab2959b852a9 (patch)
treed850be4d62ccced5e5f7a34717687f1d73dedfee
parentfea6079da7929aff63bf8ef59b20e7a04dafcf0c (diff)
parent18eb88b083779564250cee0fe7a77ae771f996ed (diff)
downloadnumpy-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.c6
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;