##// END OF EJS Templates
zeroconf: replace reduce+add with itertools.chain
timeless -
r28422:e2c6092a default
parent child Browse files
Show More
@@ -80,6 +80,7 b' from __future__ import absolute_import, '
80 __email__ = "paul at scott dash murphy dot com"
80 __email__ = "paul at scott dash murphy dot com"
81 __version__ = "0.12"
81 __version__ = "0.12"
82
82
83 import itertools
83 import select
84 import select
84 import socket
85 import socket
85 import string
86 import string
@@ -852,9 +853,8 b' class DNSCache(object):'
852
853
853 def entries(self):
854 def entries(self):
854 """Returns a list of all entries"""
855 """Returns a list of all entries"""
855 def add(x, y): return x + y
856 try:
856 try:
857 return reduce(add, self.cache.values())
857 return list(itertools.chain.from_iterable(self.cache.values()))
858 except Exception:
858 except Exception:
859 return []
859 return []
860
860
General Comments 0
You need to be logged in to leave comments. Login now