1
0
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:
Sergey Fedoseev 2017-08-08 11:02:59 +05:00
parent b5d47b18f1
commit fb0bdff981

View File

@ -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):