reduce code overhead for fused cpdef signature matching code
authorStefan Behnel <stefan_ml@behnel.de>
Fri, 11 May 2012 08:31:52 +0000 (10:31 +0200)
committerStefan Behnel <stefan_ml@behnel.de>
Fri, 11 May 2012 08:31:52 +0000 (10:31 +0200)
Cython/Compiler/FusedNode.py

index 218c769..94e706c 100644 (file)
@@ -576,10 +576,14 @@ class FusedCFuncDefNode(StatListNode):
             u"""
                 candidates = []
                 for sig in signatures:
-                    match_found = filter(None, dest_sig)
+                    match_found = False
                     for src_type, dst_type in zip(sig.strip('()').split(', '), dest_sig):
-                        if dst_type is not None and match_found:
-                            match_found = src_type == dst_type
+                        if dst_type is not None:
+                            if src_type == dst_type:
+                                match_found = True
+                            else:
+                                match_found = False
+                                break
 
                     if match_found:
                         candidates.append(sig)