summaryrefslogtreecommitdiff
path: root/django/utils/cache.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2017-06-01 16:08:59 -0700
committerTim Graham <timograham@gmail.com>2017-06-01 19:08:59 -0400
commit2c69824e5ab5ddf4b9964c4cf9f9e16ff3bb7929 (patch)
tree65b8e60b858e4f073a04c2bbf976b8f43fe0cff6 /django/utils/cache.py
parentedee5a8de6afb34a9247de2bb73ab66397a6e573 (diff)
downloaddjango-2c69824e5ab5ddf4b9964c4cf9f9e16ff3bb7929.tar.gz
Refs #23968 -- Removed unnecessary lists, generators, and tuple calls.
Diffstat (limited to 'django/utils/cache.py')
-rw-r--r--django/utils/cache.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/utils/cache.py b/django/utils/cache.py
index 7e7428f112..e8576b539f 100644
--- a/django/utils/cache.py
+++ b/django/utils/cache.py
@@ -287,7 +287,7 @@ def patch_vary_headers(response, newheaders):
else:
vary_headers = []
# Use .lower() here so we treat headers as case-insensitive.
- existing_headers = set(header.lower() for header in vary_headers)
+ existing_headers = {header.lower() for header in vary_headers}
additional_headers = [newheader for newheader in newheaders
if newheader.lower() not in existing_headers]
response['Vary'] = ', '.join(vary_headers + additional_headers)
@@ -300,7 +300,7 @@ def has_vary_header(response, header_query):
if not response.has_header('Vary'):
return False
vary_headers = cc_delim_re.split(response['Vary'])
- existing_headers = set(header.lower() for header in vary_headers)
+ existing_headers = {header.lower() for header in vary_headers}
return header_query.lower() in existing_headers