[Numpy-svn] r3140 - trunk/numpy/core/src

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Sep 11 11:52:34 CDT 2006


Author: oliphant
Date: 2006-09-11 11:52:31 -0500 (Mon, 11 Sep 2006)
New Revision: 3140

Modified:
   trunk/numpy/core/src/ufuncobject.c
Log:
Fix ReplaceLoopBySignature.

Modified: trunk/numpy/core/src/ufuncobject.c
===================================================================
--- trunk/numpy/core/src/ufuncobject.c	2006-09-08 17:17:31 UTC (rev 3139)
+++ trunk/numpy/core/src/ufuncobject.c	2006-09-11 16:52:31 UTC (rev 3140)
@@ -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 at ee.byu.edu (oliphant.travis at ieee.org)
+  Travis E. Oliphant  2005, 2006 oliphant at ee.byu.edu (oliphant.travis at ieee.org)
+  Brigham Young University
 
   based on the
 
@@ -3030,20 +3031,23 @@
 			       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;
 
 }
 



More information about the Numpy-svn mailing list