diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2017-06-01 16:08:59 -0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-06-01 19:08:59 -0400 |
| commit | 2c69824e5ab5ddf4b9964c4cf9f9e16ff3bb7929 (patch) | |
| tree | 65b8e60b858e4f073a04c2bbf976b8f43fe0cff6 /django/db/models/sql/query.py | |
| parent | edee5a8de6afb34a9247de2bb73ab66397a6e573 (diff) | |
Refs #23968 -- Removed unnecessary lists, generators, and tuple calls.
Diffstat (limited to 'django/db/models/sql/query.py')
| -rw-r--r-- | django/db/models/sql/query.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 39f40d604d..d53bd7758c 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -1251,8 +1251,7 @@ class Query: # (Consider case where rel_a is LOUTER and rel_a__col=1 is added - if # rel_a doesn't produce any rows, then the whole condition must fail. # So, demotion is OK. - existing_inner = set( - (a for a in self.alias_map if self.alias_map[a].join_type == INNER)) + existing_inner = {a for a in self.alias_map if self.alias_map[a].join_type == INNER} clause, _ = self._add_q(q_object, self.used_aliases) if clause: self.where.add(clause, AND) @@ -1437,8 +1436,8 @@ class Query: for pos, info in enumerate(reversed(path)): if len(joins) == 1 or not info.direct: break - join_targets = set(t.column for t in info.join_field.foreign_related_fields) - cur_targets = set(t.column for t in targets) + join_targets = {t.column for t in info.join_field.foreign_related_fields} + cur_targets = {t.column for t in targets} if not cur_targets.issubset(join_targets): break targets_dict = {r[1].column: r[0] for r in info.join_field.related_fields if r[1].column in cur_targets} |
