diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-09-11 16:52:31 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-09-11 16:52:31 +0000 |
commit | b473660ffab11a7b90c96cc5f2473694d6249761 (patch) | |
tree | facd7c3b45c9264a8a07ea7f4f8662fbafd9952f | |
parent | 14fbb3bdfa9bcbd0371fcdaf88a8a4c095d3b366 (diff) | |
download | numpy-b473660ffab11a7b90c96cc5f2473694d6249761.tar.gz |
Fix ReplaceLoopBySignature.
-rw-r--r-- | numpy/core/src/ufuncobject.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/numpy/core/src/ufuncobject.c b/numpy/core/src/ufuncobject.c index 1f87fd21c..56b31ac8b 100644 --- a/numpy/core/src/ufuncobject.c +++ b/numpy/core/src/ufuncobject.c @@ -7,7 +7,8 @@ This supports mathematical (and Boolean) functions on arrays and other python objects. Math on large arrays of basic C types is rather efficient. - Travis E. Oliphant (2005-2006), oliphant@ee.byu.edu (oliphant.travis@ieee.org) + Travis E. Oliphant 2005, 2006 oliphant@ee.byu.edu (oliphant.travis@ieee.org) + Brigham Young University based on the @@ -3030,20 +3031,23 @@ PyUFunc_ReplaceLoopBySignature(PyUFuncObject *func, PyUFuncGenericFunction *oldfunc) { int i,j; + int res = -1; /* Find the location of the matching signature */ for (i=0; i<func->ntypes; i++) { for (j=0; j<func->nargs; j++) { if (signature[j] == func->types[i*func->nargs+j]) break; } - if (j >= func->nargs) return -1; + if (j >= func->nargs) continue; if (oldfunc != NULL) { *oldfunc = func->functions[i]; } func->functions[i] = newfunc; + res = 0; + break; } - return -1; + return res; } |