Mercurial > public > mercurial-scm > hg
comparison mercurial/keepalive.py @ 7622:4dd7b28003d2
use dict.iteritems() rather than dict.items()
This should be faster and more future-proof. Calls where the result is to be
sorted using util.sort() have been left unchanged. Calls to .items() on
configparser objects have been left as-is, too.
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Mon, 12 Jan 2009 09:16:03 +0100 |
parents | ac0bcd951c2c |
children | a45206455d85 |
comparison
equal
deleted
inserted
replaced
7621:6d891df43a5f | 7622:4dd7b28003d2 |
---|---|
195 self._cm.remove(h) | 195 self._cm.remove(h) |
196 h.close() | 196 h.close() |
197 | 197 |
198 def close_all(self): | 198 def close_all(self): |
199 """close all open connections""" | 199 """close all open connections""" |
200 for host, conns in self._cm.get_all().items(): | 200 for host, conns in self._cm.get_all().iteritems(): |
201 for h in conns: | 201 for h in conns: |
202 self._cm.remove(h) | 202 self._cm.remove(h) |
203 h.close() | 203 h.close() |
204 | 204 |
205 def _request_closed(self, request, host, connection): | 205 def _request_closed(self, request, host, connection): |