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
94aede41
Commit
94aede41
authored
Feb 02, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cython could generate useless argument tuple parsing code for functions with required kw-only args
parent
20ad25cf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+8
-5
No files found.
Cython/Compiler/Nodes.py
View file @
94aede41
...
...
@@ -1260,16 +1260,19 @@ class DefNode(FuncDefNode):
our_error_label
=
code
.
error_label
end_label
=
code
.
new_label
()
# Unpack inplace if it's simple
has_self_arg
=
len
(
self
.
args
)
>
0
and
self
.
args
[
0
].
is_self_arg
if
self
.
num_required_args
==
len
(
positional_args
)
+
has_self_arg
:
min_positional_args
=
self
.
num_required_args
-
self
.
num_required_kw_args
max_positional_args
=
len
(
positional_args
)
if
len
(
self
.
args
)
>
0
and
self
.
args
[
0
].
is_self_arg
:
min_positional_args
-=
1
if
max_positional_args
==
min_positional_args
:
count_cond
=
"likely(PyTuple_GET_SIZE(%s) == %s)"
%
(
Naming
.
args_cname
,
len
(
positional_args
)
)
Naming
.
args_cname
,
max_positional_args
)
else
:
count_cond
=
"likely(%s <= PyTuple_GET_SIZE(%s)) && likely(PyTuple_GET_SIZE(%s) <= %s)"
%
(
self
.
num_required_args
-
has_self_arg
,
min_positional_args
,
Naming
.
args_cname
,
Naming
.
args_cname
,
len
(
positional_args
)
)
max_positional_args
)
code
.
putln
(
'if (likely(!%s) && %s) {'
%
(
Naming
.
kwds_cname
,
count_cond
))
i
=
0
...
...
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