mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-33712: OrderedDict only creates od_fast_nodes cache if needed (GH-7349)
This commit is contained in:
parent
d6a61f2326
commit
6f17e51345
2 changed files with 20 additions and 52 deletions
|
@ -697,9 +697,9 @@ class CPythonOrderedDictTests(OrderedDictTests, unittest.TestCase):
|
|||
nodesize = calcsize('Pn2P')
|
||||
|
||||
od = OrderedDict()
|
||||
check(od, basicsize + 8*p + 8 + 5*entrysize) # 8byte indices + 8*2//3 * entry table
|
||||
check(od, basicsize + 8 + 5*entrysize) # 8byte indices + 8*2//3 * entry table
|
||||
od.x = 1
|
||||
check(od, basicsize + 8*p + 8 + 5*entrysize)
|
||||
check(od, basicsize + 8 + 5*entrysize)
|
||||
od.update([(i, i) for i in range(3)])
|
||||
check(od, basicsize + 8*p + 8 + 5*entrysize + 3*nodesize)
|
||||
od.update([(i, i) for i in range(3, 10)])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue