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
15cade05
Commit
15cade05
authored
Feb 19, 2007
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixup set/dict interoperability.
parent
cbac8ce5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
Objects/setobject.c
Objects/setobject.c
+11
-0
No files found.
Objects/setobject.c
View file @
15cade05
...
...
@@ -919,7 +919,18 @@ set_update_internal(PySetObject *so, PyObject *other)
PyObject
*
value
;
Py_ssize_t
pos
=
0
;
long
hash
;
Py_ssize_t
dictsize
=
PyDict_Size
(
other
);
/* Do one big resize at the start, rather than
* incrementally resizing as we insert new keys. Expect
* that there will be no (or few) overlapping keys.
*/
if
(
dictsize
==
-
1
)
return
-
1
;
if
((
so
->
fill
+
dictsize
)
*
3
>=
(
so
->
mask
+
1
)
*
2
)
{
if
(
set_table_resize
(
so
,
(
so
->
used
+
dictsize
)
*
2
)
!=
0
)
return
-
1
;
}
while
(
_PyDict_Next
(
other
,
&
pos
,
&
key
,
&
value
,
&
hash
))
{
setentry
an_entry
;
...
...
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