From aadd3aeb2ba3153e35bd805c80c901f289a6f333 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Mon, 31 Jul 2017 20:02:23 +0500 Subject: Avoided creating temporary lists for obtaining the first item. --- django/db/models/sql/query.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'django/db/models/sql') 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): """ -- cgit v1.3