Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
514f2542
Commit
514f2542
authored
May 27, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docstrings
parent
72cf1a61
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+3
-1
No files found.
Cython/Compiler/Optimize.py
View file @
514f2542
...
...
@@ -1189,6 +1189,8 @@ class EarlyReplaceBuiltinCalls(Visitor.EnvTransform):
expr_scope
=
gen_expr_node
.
expr_scope
)
def
_handle_simple_function_sum
(
self
,
node
,
pos_args
):
"""Transform sum(genexpr) into an equivalent inlined aggregation loop.
"""
if
len
(
pos_args
)
not
in
(
1
,
2
):
return
node
if
not
isinstance
(
pos_args
[
0
],
ExprNodes
.
GeneratorExpressionNode
):
...
...
@@ -1728,7 +1730,7 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
return
self
.
_optimise_min_max
(
node
,
pos_args
,
'>'
)
def
_optimise_min_max
(
self
,
node
,
args
,
operator
):
"""Replace min(a,b,...) and max(a,b,...) by explicit co
nditional
code.
"""Replace min(a,b,...) and max(a,b,...) by explicit co
mparison
code.
"""
if
len
(
args
)
<=
1
:
# leave this to Python
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment