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
9a87a957
Commit
9a87a957
authored
Sep 21, 2013
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the linear probe sequence clearer.
parent
023004b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
Objects/setobject.c
Objects/setobject.c
+4
-8
No files found.
Objects/setobject.c
View file @
9a87a957
...
@@ -62,7 +62,6 @@ set_lookkey(PySetObject *so, PyObject *key, Py_hash_t hash)
...
@@ -62,7 +62,6 @@ set_lookkey(PySetObject *so, PyObject *key, Py_hash_t hash)
size_t
i
=
(
size_t
)
hash
;
/* Unsigned for defined overflow behavior. */
size_t
i
=
(
size_t
)
hash
;
/* Unsigned for defined overflow behavior. */
int
cmp
;
int
cmp
;
#if LINEAR_PROBES
#if LINEAR_PROBES
setentry
*
limit
;
size_t
j
;
size_t
j
;
#endif
#endif
...
@@ -89,9 +88,8 @@ set_lookkey(PySetObject *so, PyObject *key, Py_hash_t hash)
...
@@ -89,9 +88,8 @@ set_lookkey(PySetObject *so, PyObject *key, Py_hash_t hash)
freeslot
=
entry
;
freeslot
=
entry
;
#if LINEAR_PROBES
#if LINEAR_PROBES
limit
=
&
table
[
mask
];
for
(
j
=
1
;
j
<=
LINEAR_PROBES
;
j
++
)
{
for
(
j
=
0
;
j
<
LINEAR_PROBES
;
j
++
)
{
entry
=
&
table
[(
i
+
j
)
&
mask
];
entry
=
(
entry
==
limit
)
?
&
table
[
0
]
:
entry
+
1
;
if
(
entry
->
key
==
NULL
)
if
(
entry
->
key
==
NULL
)
goto
found_null
;
goto
found_null
;
if
(
entry
->
key
==
key
)
if
(
entry
->
key
==
key
)
...
@@ -139,7 +137,6 @@ set_lookkey_unicode(PySetObject *so, PyObject *key, Py_hash_t hash)
...
@@ -139,7 +137,6 @@ set_lookkey_unicode(PySetObject *so, PyObject *key, Py_hash_t hash)
size_t
mask
=
so
->
mask
;
size_t
mask
=
so
->
mask
;
size_t
i
=
(
size_t
)
hash
;
size_t
i
=
(
size_t
)
hash
;
#if LINEAR_PROBES
#if LINEAR_PROBES
setentry
*
limit
;
size_t
j
;
size_t
j
;
#endif
#endif
...
@@ -166,9 +163,8 @@ set_lookkey_unicode(PySetObject *so, PyObject *key, Py_hash_t hash)
...
@@ -166,9 +163,8 @@ set_lookkey_unicode(PySetObject *so, PyObject *key, Py_hash_t hash)
freeslot
=
entry
;
freeslot
=
entry
;
#if LINEAR_PROBES
#if LINEAR_PROBES
limit
=
&
table
[
mask
];
for
(
j
=
1
;
j
<=
LINEAR_PROBES
;
j
++
)
{
for
(
j
=
0
;
j
<
LINEAR_PROBES
;
j
++
)
{
entry
=
&
table
[(
i
+
j
)
&
mask
];
entry
=
(
entry
==
limit
)
?
&
table
[
0
]
:
entry
+
1
;
if
(
entry
->
key
==
NULL
)
if
(
entry
->
key
==
NULL
)
goto
found_null
;
goto
found_null
;
if
(
entry
->
key
==
key
if
(
entry
->
key
==
key
...
...
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