Commit ef8f00ca authored by Vincent Pelletier's avatar Vincent Pelletier

Micro-optimisations.

parent b6475dc3
...@@ -26,8 +26,8 @@ class EpollEventManager(object): ...@@ -26,8 +26,8 @@ class EpollEventManager(object):
def __init__(self): def __init__(self):
self.connection_dict = {} self.connection_dict = {}
self.reader_set = set([]) self.reader_set = set()
self.writer_set = set([]) self.writer_set = set()
self.epoll = epoll() self.epoll = epoll()
self._pending_processing = [] self._pending_processing = []
...@@ -38,7 +38,8 @@ class EpollEventManager(object): ...@@ -38,7 +38,8 @@ class EpollEventManager(object):
def getConnectionList(self): def getConnectionList(self):
# XXX: use index # XXX: use index
return [x for x in self.connection_dict.values() if not x.isAborted()] return [x for x in self.connection_dict.itervalues()
if not x.isAborted()]
def getClientList(self): def getClientList(self):
# XXX: use index # XXX: use index
......
...@@ -410,7 +410,7 @@ class NodeManager(object): ...@@ -410,7 +410,7 @@ class NodeManager(object):
if pool_set is not None: if pool_set is not None:
identified_nodes = self._identified_dict.items() identified_nodes = self._identified_dict.items()
return [v for k, v in identified_nodes if k in pool_set] return [v for k, v in identified_nodes if k in pool_set]
return list(self._identified_dict.values()) return self._identified_dict.values()
def getConnectedList(self): def getConnectedList(self):
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment