From a1d631b39eca6bf75b0ea6d8d3d1366164d1b73f Mon Sep 17 00:00:00 2001 From: Daniel Goldberg Date: Fri, 27 Sep 2019 16:33:29 +0300 Subject: [PATCH] Remove list comprehension --- monkey/infection_monkey/network/network_scanner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/infection_monkey/network/network_scanner.py b/monkey/infection_monkey/network/network_scanner.py index da3d88e5f..3e447b85e 100644 --- a/monkey/infection_monkey/network/network_scanner.py +++ b/monkey/infection_monkey/network/network_scanner.py @@ -90,7 +90,7 @@ class NetworkScanner(object): return results = pool.map(self.scan_machine, victim_chunk) - resulting_victims = [x for x in results if x] # filter out dead addresses + resulting_victims = filter(lambda x: x is not None, results) for victim in resulting_victims: LOG.debug("Found potential victim: %r", victim) victims_count += 1