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
b44c5169
Commit
b44c5169
authored
Jan 16, 2018
by
Raymond Hettinger
Committed by
GitHub
Jan 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-26163: Frozenset hash improvement (#5194)
parent
94e1696d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
Misc/NEWS.d/next/Core and Builtins/2018-01-14-20-32-47.bpo-26163.xv9Iuv.rst
...ore and Builtins/2018-01-14-20-32-47.bpo-26163.xv9Iuv.rst
+2
-0
Objects/setobject.c
Objects/setobject.c
+1
-0
No files found.
Misc/NEWS.d/next/Core and Builtins/2018-01-14-20-32-47.bpo-26163.xv9Iuv.rst
0 → 100644
View file @
b44c5169
Improved frozenset() hash to create more distinct hash values when faced
with datasets containing many similar values.
Objects/setobject.c
View file @
b44c5169
...
...
@@ -795,6 +795,7 @@ frozenset_hash(PyObject *self)
hash
^=
((
Py_uhash_t
)
PySet_GET_SIZE
(
self
)
+
1
)
*
1927868237UL
;
/* Disperse patterns arising in nested frozensets */
hash
^=
(
hash
>>
11
)
^
(
~
hash
>>
25
);
hash
=
hash
*
69069U
+
907133923UL
;
/* -1 is reserved as an error code */
...
...
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