From: Eric S. Raymond Date: Thu, 27 Sep 2012 15:37:06 +0000 (-0400) Subject: nenolod's fix for overzealous garbage collection. X-Git-Tag: 1.0~24 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ef1d7d31363ceb8449aaa73f2ceb9ff8ed331f82;p=irker.git nenolod's fix for overzealous garbage collection. --- diff --git a/irker b/irker index cdd247b..f3167f6 100755 --- a/irker +++ b/irker @@ -220,9 +220,9 @@ class Dispatcher: self.connections = [] def dispatch(self, channel, message): "Dispatch messages for our server-port combination." - self.connections = [x for x in self.connections if x.live()] - eligibles = [x for x in self.connections if x.joined_to(channel)] \ - or [x for x in self.connections if x.accepting(channel)] + connections = [x for x in self.connections if x.live()] + eligibles = [x for x in connections if x.joined_to(channel)] \ + or [x for x in connections if x.accepting(channel)] if not eligibles: newconn = Connection(self.irker, self.servername, @@ -234,7 +234,7 @@ class Dispatcher: def live(self): "Does this server-port combination have any live connections?" self.connections = [x for x in self.connections if x.live()] - return not self.connections + return len(self.connections) > 0 class Irker: "Persistent IRC multiplexer."