mirror of
https://github.com/python/cpython.git
synced 2025-09-25 09:50:37 +00:00
Hold key reference until the links have updated.
This commit is contained in:
parent
bb2dad8915
commit
5ded795a72
1 changed files with 1 additions and 1 deletions
|
@ -66,7 +66,7 @@ class OrderedDict(dict):
|
||||||
# Deleting an existing item uses self.__map to find the link which gets
|
# Deleting an existing item uses self.__map to find the link which gets
|
||||||
# removed by updating the links in the predecessor and successor nodes.
|
# removed by updating the links in the predecessor and successor nodes.
|
||||||
dict_delitem(self, key)
|
dict_delitem(self, key)
|
||||||
link_prev, link_next, key = self.__map.pop(key)
|
link_prev, link_next, _ = self.__map.pop(key)
|
||||||
link_prev[1] = link_next # update link_prev[NEXT]
|
link_prev[1] = link_next # update link_prev[NEXT]
|
||||||
link_next[0] = link_prev # update link_next[PREV]
|
link_next[0] = link_prev # update link_next[PREV]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue