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
d61d0733
Commit
d61d0733
authored
Aug 01, 2006
by
Thomas Heller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed up PyType_stgdict and PyObject_stgdict.
parent
07fec3aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
Modules/_ctypes/stgdict.c
Modules/_ctypes/stgdict.c
+11
-2
No files found.
Modules/_ctypes/stgdict.c
View file @
d61d0733
...
...
@@ -134,16 +134,25 @@ PyType_stgdict(PyObject *obj)
type
=
(
PyTypeObject
*
)
obj
;
if
(
!
PyType_HasFeature
(
type
,
Py_TPFLAGS_HAVE_CLASS
))
return
NULL
;
if
(
!
type
->
tp_dict
||
!
StgDict_Check
(
type
->
tp_dict
))
if
(
!
type
->
tp_dict
||
!
StgDict_Check
Exact
(
type
->
tp_dict
))
return
NULL
;
return
(
StgDictObject
*
)
type
->
tp_dict
;
}
/* May return NULL, but does not set an exception! */
/*
This function should be as fast as possible, so we don't call PyType_stgdict
above but inline the code, and avoid the PyType_Check().
*/
StgDictObject
*
PyObject_stgdict
(
PyObject
*
self
)
{
return
PyType_stgdict
((
PyObject
*
)
self
->
ob_type
);
PyTypeObject
*
type
=
self
->
ob_type
;
if
(
!
PyType_HasFeature
(
type
,
Py_TPFLAGS_HAVE_CLASS
))
return
NULL
;
if
(
!
type
->
tp_dict
||
!
StgDict_CheckExact
(
type
->
tp_dict
))
return
NULL
;
return
(
StgDictObject
*
)
type
->
tp_dict
;
}
/* descr is the descriptor for a field marked as anonymous. Get all the
...
...
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