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
6f51454c
Commit
6f51454c
authored
Jul 27, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prevent useless method call 'optimisation' for inner functions and classes
parent
ba59a707
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+2
-2
No files found.
Cython/Compiler/Optimize.py
View file @
6f51454c
...
...
@@ -4204,12 +4204,12 @@ class FinalOptimizePhase(Visitor.CythonTransform, Visitor.NodeRefCleanupMixin):
elif
function
.
is_name
:
if
function
.
entry
.
is_builtin
:
may_be_a_method
=
False
elif
function
.
cf_state
:
elif
function
.
entry
.
cf_assignments
:
# local functions/classes are definitely not methods
non_method_nodes
=
(
ExprNodes
.
PyCFunctionNode
,
ExprNodes
.
ClassNode
,
ExprNodes
.
Py3ClassNode
)
may_be_a_method
=
any
(
assignment
.
rhs
and
not
isinstance
(
assignment
.
rhs
,
non_method_nodes
)
for
assignment
in
function
.
cf_state
)
for
assignment
in
function
.
entry
.
cf_assignments
)
if
may_be_a_method
:
node
=
self
.
replace
(
node
,
ExprNodes
.
PyMethodCallNode
.
from_node
(
node
,
function
=
function
,
arg_tuple
=
node
.
arg_tuple
,
type
=
node
.
type
))
...
...
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