summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2016-12-31 12:03:16 -0700
committerRaymond Hettinger <python@rcn.com>2016-12-31 12:03:16 -0700
commit4825f49ea59e6a7694d50489e3fd3cc6b51d4fa4 (patch)
tree4b9f655263a40261c29ec62266d320b4ca86fbc2
parent81b64ff01b0f909dd379dc98229937eec9f17891 (diff)
parenta67619ec5f0719daa14240469872ecff9596673e (diff)
downloadcpython-git-4825f49ea59e6a7694d50489e3fd3cc6b51d4fa4.tar.gz
merge
-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 bcc429195d..85b4c3c19a 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