summaryrefslogtreecommitdiff
path: root/django/urls
diff options
context:
space:
mode:
authorДилян Палаузов <Dilyan.Palauzov@db.com>2017-12-27 00:14:12 +0530
committerTim Graham <timograham@gmail.com>2017-12-26 17:11:15 -0500
commit4c599ece57fa009cf3615f09497f81bfa6a585a7 (patch)
tree1f27a7e76024aaa5bc69356826061262d35d0be3 /django/urls
parentc21f158295d92e35caf96436bfdbbff554fc5569 (diff)
Fixed #28930 -- Simplified code with any() and all().
Diffstat (limited to 'django/urls')
-rw-r--r--django/urls/resolvers.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/django/urls/resolvers.py b/django/urls/resolvers.py
index 758eaef218..3f48d72fed 100644
--- a/django/urls/resolvers.py
+++ b/django/urls/resolvers.py
@@ -572,12 +572,7 @@ class URLResolver:
else:
if set(kwargs).symmetric_difference(params).difference(defaults):
continue
- matches = True
- for k, v in defaults.items():
- if kwargs.get(k, v) != v:
- matches = False
- break
- if not matches:
+ if any(kwargs.get(k, v) != v for k, v in defaults.items()):
continue
candidate_subs = kwargs
# Convert the candidate subs to text using Converter.to_url().