Fixed #15283 -- Made a minor performance tweak to __iter__. Thanks to lanyjie for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15491 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2011-02-12 05:23:41 +00:00
parent b01cc1bd89
commit 337a6bc0f6
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ class QuerySet(object):
else: else:
self._result_cache = list(self.iterator()) self._result_cache = list(self.iterator())
elif self._iter: elif self._iter:
self._result_cache.extend(list(self._iter)) self._result_cache.extend(self._iter)
return len(self._result_cache) return len(self._result_cache)
def __iter__(self): def __iter__(self):