summaryrefslogtreecommitdiff
path: root/django/db/models/sql/query.py
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2017-07-31 20:02:23 +0500
committerTim Graham <timograham@gmail.com>2017-07-31 11:02:23 -0400
commitaadd3aeb2ba3153e35bd805c80c901f289a6f333 (patch)
tree20d37a25e7ae620c12886dfe5aed981590dfd2dc /django/db/models/sql/query.py
parent0f905e4b4479894f67b12ad976402a9660f0cae4 (diff)
Avoided creating temporary lists for obtaining the first item.
Diffstat (limited to 'django/db/models/sql/query.py')
-rw-r--r--django/db/models/sql/query.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index b691fc424b..48bbd7c851 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -217,7 +217,8 @@ class Query:
@cached_property
def base_table(self):
- return list(self.alias_map)[0] if self.alias_map else None
+ for alias in self.alias_map:
+ return alias
def __str__(self):
"""