Call dict.values once instead of N times.
---
lib/http/client.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lib/http/client.py b/lib/http/client.py
index 84cd0b7..1e02e4c 100644
--- a/lib/http/client.py
+++ b/lib/http/client.py
@@ -352,10 +352,11 @@ class HttpClientPool:
"""Returns HTTP clients to the pool.
"""
+ assert not frozenset(pclients) & frozenset(self._pool.values())
+
for pc in pclients:
self._logger.debug("Returning client %s to pool", pc)
assert pc.identity not in self._pool
- assert pc not in self._pool.values()
self._pool[pc.identity] = pc
# Check for unused clients
--
1.7.6