diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-09-10 22:23:24 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-09-10 22:23:24 +0000 |
| commit | 9d1a7c203ce8f24aa1aa255ccdec3ace194012c6 (patch) | |
| tree | 5eb56e1bf6fe649df8da2cbaad252165331dc0d8 | |
| parent | 84ef9dabfab371a1e0f14a846a509e045369280d (diff) | |
Micro-optomization to SortedDict.values(). Yes, it looks silly, but it shaves 30 seconds (5%) off the run time of the test suite.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11494 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/utils/datastructures.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/utils/datastructures.py b/django/utils/datastructures.py index ce2424065d..4d9c61ffba 100644 --- a/django/utils/datastructures.py +++ b/django/utils/datastructures.py @@ -117,7 +117,8 @@ class SortedDict(dict): return iter(self.keyOrder) def values(self): - return [super(SortedDict, self).__getitem__(k) for k in self.keyOrder] + super_get = super(SortedDict, self).__getitem__ + return [super_get(k) for k in self.keyOrder] def itervalues(self): for key in self.keyOrder: |
