]> granicus.if.org Git - python/commitdiff
Minor code simplification.
authorRaymond Hettinger <python@rcn.com>
Sat, 23 Apr 2011 22:41:38 +0000 (15:41 -0700)
committerRaymond Hettinger <python@rcn.com>
Sat, 23 Apr 2011 22:41:38 +0000 (15:41 -0700)
Lib/collections.py

index f2ae8ea5c1d45a027c63a3f2f1330cefcf743d69..321daa394eca0dbed63d2afe1b63af0ee3204b99 100644 (file)
@@ -45,10 +45,8 @@ class OrderedDict(dict):
         try:
             self.__root
         except AttributeError:
-            self.__root = root = [None, None, None]     # sentinel node
-            PREV = 0
-            NEXT = 1
-            root[PREV] = root[NEXT] = root
+            self.__root = root = []                     # sentinel node
+            root[:] = [root, root, None]
             self.__map = {}
         self.__update(*args, **kwds)