Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
79d6e8de
Commit
79d6e8de
authored
Apr 19, 2016
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #26802: Optimized calling a function with *args only positional arguments.
Patch by Joe Jevnik.
parent
5bfe0da8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
Python/ceval.c
Python/ceval.c
+15
-0
No files found.
Python/ceval.c
View file @
79d6e8de
...
...
@@ -4890,6 +4890,21 @@ update_star_args(int nstack, int nstar, PyObject *stararg,
{
PyObject
*
callargs
,
*
w
;
if
(
!
nstack
)
{
if
(
!
stararg
)
{
/* There are no positional arguments on the stack and there is no
sequence to be unpacked. */
return
PyTuple_New
(
0
);
}
if
(
PyTuple_CheckExact
(
stararg
))
{
/* No arguments are passed on the stack and the sequence is not a
tuple subclass so we can just pass the stararg tuple directly
to the function. */
Py_INCREF
(
stararg
);
return
stararg
;
}
}
callargs
=
PyTuple_New
(
nstack
+
nstar
);
if
(
callargs
==
NULL
)
{
return
NULL
;
...
...
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