Browse Source

Removing the overhead of creating a new list per event

master
fa08c 10 years ago
parent
commit
ebfd1486d8
  1. 7
      shadowsocks/eventloop.py

7
shadowsocks/eventloop.py

@ -232,9 +232,10 @@ class EventLoop(object):
logging.error(e) logging.error(e)
import traceback import traceback
traceback.print_exc() traceback.print_exc()
for handler in self._handlers_to_remove: if self._handlers_to_remove:
self._handlers.remove(handler) for handler in self._handlers_to_remove:
self._handlers_to_remove = [] self._handlers.remove(handler)
self._handlers_to_remove = []
self._iterating = False self._iterating = False

Loading…
Cancel
Save