summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2016-12-31 19:02:42 (GMT)
committerRaymond Hettinger <python@rcn.com>2016-12-31 19:02:42 (GMT)
commita67619ec5f0719daa14240469872ecff9596673e (patch)
treee0cae8e675d4672f23f6654677da5d35a0e474a6 /Lib
parent9db22dd968c043beb9abc6233360336018da5249 (diff)
parentb46ea9034349b9d713daff581e624afe07916629 (diff)
downloadcpython-a67619ec5f0719daa14240469872ecff9596673e.zip
cpython-a67619ec5f0719daa14240469872ecff9596673e.tar.gz
cpython-a67619ec5f0719daa14240469872ecff9596673e.tar.bz2
merge
Diffstat (limited to 'Lib')
-rw-r--r--Lib/collections/__init__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
index bcc4291..85b4c3c 100644
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -189,6 +189,7 @@ class OrderedDict(dict):
link = self.__map[key]
link_prev = link.prev
link_next = link.next
+ soft_link = link_next.prev
link_prev.next = link_next
link_next.prev = link_prev
root = self.__root
@@ -196,12 +197,14 @@ class OrderedDict(dict):
last = root.prev
link.prev = last
link.next = root
- last.next = root.prev = link
+ root.prev = soft_link
+ last.next = link
else:
first = root.next
link.prev = root
link.next = first
- root.next = first.prev = link
+ first.prev = soft_link
+ root.next = link
def __sizeof__(self):
sizeof = _sys.getsizeof