Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
nexedi
cython
Commits
a16d61b9
Commit
a16d61b9
authored
Jul 31, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
13ad80a3
ae9630e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
14 deletions
+18
-14
ExprNodes.py
Cython/Compiler/ExprNodes.py
+18
-14
No files found.
Cython/Compiler/ExprNodes.py
View file @
a16d61b9
...
...
@@ -1169,20 +1169,24 @@ class NextNode(AtomicExprNode):
self
.
is_temp
=
1
def
generate_result_code
(
self
,
code
):
code
.
putln
(
"if (likely(
%
s != -1)) {"
%
self
.
iterator
.
counter
.
result_code
)
code
.
putln
(
"if (
%
s >= PySequence_Fast_GET_SIZE(
%
s)) break;"
%
(
self
.
iterator
.
counter
.
result_code
,
self
.
iterator
.
py_result
()))
code
.
putln
(
"
%
s = PySequence_Fast_GET_ITEM(
%
s,
%
s); Py_INCREF(
%
s);
%
s++;"
%
(
self
.
result_code
,
self
.
iterator
.
py_result
(),
self
.
iterator
.
counter
.
result_code
,
self
.
result_code
,
self
.
iterator
.
counter
.
result_code
))
code
.
putln
(
"} else {"
)
for
py_type
in
[
"List"
,
"Tuple"
]:
code
.
putln
(
"if (likely(Py
%
s_CheckExact(
%
s))) {"
%
(
py_type
,
self
.
iterator
.
py_result
()))
code
.
putln
(
"if (
%
s >= Py
%
s_GET_SIZE(
%
s)) break;"
%
(
self
.
iterator
.
counter
.
result_code
,
py_type
,
self
.
iterator
.
py_result
()))
code
.
putln
(
"
%
s = Py
%
s_GET_ITEM(
%
s,
%
s); Py_INCREF(
%
s);
%
s++;"
%
(
self
.
result_code
,
py_type
,
self
.
iterator
.
py_result
(),
self
.
iterator
.
counter
.
result_code
,
self
.
result_code
,
self
.
iterator
.
counter
.
result_code
))
code
.
put
(
"} else "
)
code
.
putln
(
"{"
)
code
.
putln
(
"
%
s = PyIter_Next(
%
s);"
%
(
self
.
result_code
,
...
...
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