From da68bab835ead256bd1f8f15a560e976c4667500 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 6 Dec 2009 22:51:09 +0100 Subject: [PATCH] cleanup --- Cython/Compiler/Optimize.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py index 69099b0d..d602c102 100644 --- a/Cython/Compiler/Optimize.py +++ b/Cython/Compiler/Optimize.py @@ -116,18 +116,16 @@ class IterationTransform(Visitor.VisitorTransform): node, dict_obj, keys, values) # enumerate() ? - if iterator.self is None and \ - isinstance(function, ExprNodes.NameNode) and \ + if iterator.self is None and function.is_name and \ function.entry and function.entry.is_builtin and \ function.name == 'enumerate': return self._transform_enumerate_iteration(node, iterator) # range() iteration? if Options.convert_range and node.target.type.is_int: - if iterator.self is None and \ - isinstance(function, ExprNodes.NameNode) and \ - function.entry and function.entry.is_builtin and \ - function.name in ('range', 'xrange'): + if iterator.self is None and function.is_name and \ + function.entry and function.entry.is_builtin and \ + function.name in ('range', 'xrange'): return self._transform_range_iteration(node, iterator) return node -- 2.26.2