Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #12632 -- Improved performance of `SortedDict`. Thanks, Alex Ga…

…ynor.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13742 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1efa80770382d4995c2d6e67972d8a99021ec81f 1 parent a56a226
@jbronn jbronn authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 django/utils/datastructures.py
View
4 django/utils/datastructures.py
@@ -120,9 +120,11 @@ def __init__(self, data=None):
self.keyOrder = data.keys()
else:
self.keyOrder = []
+ seen = set()
for key, value in data:
- if key not in self.keyOrder:
+ if key not in seen:
self.keyOrder.append(key)
+ seen.add(key)
def __deepcopy__(self, memo):
return self.__class__([(key, deepcopy(value, memo))
Please sign in to comment.
Something went wrong with that request. Please try again.