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
54b60cf6
Commit
54b60cf6
authored
Apr 29, 2016
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #26822: Decreased an overhead of using _PyArg_NoKeywords() in calls of
itemgetter, attrgetter and methodcaller objects.
parents
a5ffa2e9
6dfcde5e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Modules/_operator.c
Modules/_operator.c
+3
-3
No files found.
Modules/_operator.c
View file @
54b60cf6
...
...
@@ -460,7 +460,7 @@ itemgetter_call(itemgetterobject *ig, PyObject *args, PyObject *kw)
PyObject
*
obj
,
*
result
;
Py_ssize_t
i
,
nitems
=
ig
->
nitems
;
if
(
!
_PyArg_NoKeywords
(
"itemgetter"
,
kw
))
if
(
kw
!=
NULL
&&
!
_PyArg_NoKeywords
(
"itemgetter"
,
kw
))
return
NULL
;
if
(
!
PyArg_UnpackTuple
(
args
,
"itemgetter"
,
1
,
1
,
&
obj
))
return
NULL
;
...
...
@@ -749,7 +749,7 @@ attrgetter_call(attrgetterobject *ag, PyObject *args, PyObject *kw)
PyObject
*
obj
,
*
result
;
Py_ssize_t
i
,
nattrs
=
ag
->
nattrs
;
if
(
!
_PyArg_NoKeywords
(
"attrgetter"
,
kw
))
if
(
kw
!=
NULL
&&
!
_PyArg_NoKeywords
(
"attrgetter"
,
kw
))
return
NULL
;
if
(
!
PyArg_UnpackTuple
(
args
,
"attrgetter"
,
1
,
1
,
&
obj
))
return
NULL
;
...
...
@@ -992,7 +992,7 @@ methodcaller_call(methodcallerobject *mc, PyObject *args, PyObject *kw)
{
PyObject
*
method
,
*
obj
,
*
result
;
if
(
!
_PyArg_NoKeywords
(
"methodcaller"
,
kw
))
if
(
kw
!=
NULL
&&
!
_PyArg_NoKeywords
(
"methodcaller"
,
kw
))
return
NULL
;
if
(
!
PyArg_UnpackTuple
(
args
,
"methodcaller"
,
1
,
1
,
&
obj
))
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