1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #28930 -- Simplified code with any() and all().

This commit is contained in:
Дилян Палаузов
2017-12-27 00:14:12 +05:30
committed by Tim Graham
parent c21f158295
commit 4c599ece57
18 changed files with 54 additions and 115 deletions

View File

@@ -106,10 +106,7 @@ class Signal:
with self.lock:
self._clear_dead_receivers()
for r_key, _ in self.receivers:
if r_key == lookup_key:
break
else:
if not any(r_key == lookup_key for r_key, _ in self.receivers):
self.receivers.append((lookup_key, receiver))
self.sender_receivers_cache.clear()