mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Refs #28459 -- Improved performance of ValuesIterable.
This commit is contained in:
parent
b5d47b18f1
commit
fb0bdff981
@ -102,8 +102,9 @@ class ValuesIterable(BaseIterable):
|
||||
# extra(select=...) cols are always at the start of the row.
|
||||
names = extra_names + field_names + annotation_names
|
||||
|
||||
indexes = range(len(names))
|
||||
for row in compiler.results_iter():
|
||||
yield dict(zip(names, row))
|
||||
yield {names[i]: row[i] for i in indexes}
|
||||
|
||||
|
||||
class ValuesListIterable(BaseIterable):
|
||||
|
Loading…
Reference in New Issue
Block a user