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:
parent
b01cc1bd89
commit
337a6bc0f6
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue