summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2015-07-04 00:21:17 (GMT)
committerRaymond Hettinger <python@rcn.com>2015-07-04 00:21:17 (GMT)
commit15f08696096a80d026ed21164f892a661fc72e98 (patch)
tree5c8b25b7c0924225da104a3ca6aa7b96df4d4bd1 /Include
parentdf418b67aba4a31ba9fc8a80372d58b82b768b72 (diff)
downloadcpython-15f08696096a80d026ed21164f892a661fc72e98.zip
cpython-15f08696096a80d026ed21164f892a661fc72e98.tar.gz
cpython-15f08696096a80d026ed21164f892a661fc72e98.tar.bz2
Move insertion resize logic into set_insert_key().
Simplifies the code a little bit and does the resize check only when a new key is added (giving a small speed up in the case where the key already exists). Fixes possible bug in set_merge() where the set_insert_key() call relies on a big resize at the start to make enough room for the keys but is vulnerable to a comparision callback that could cause the table to shrink in the middle of the merge. Also, changed the resize threshold from two-thirds of the mask+1 to just two-thirds. The plus one offset gave no real benefit (afterall, the two-thirds mark is just a heuristic and isn't a precise cut-off).
Diffstat (limited to 'Include')
0 files changed, 0 insertions, 0 deletions