forked from p15670423/monkey
Agent: Improve performance of _remove_ips_from_scan_targets()
This commit is contained in:
parent
ec9aaf6b38
commit
7c786b0883
|
@ -99,13 +99,8 @@ def _remove_blocklisted_ips(
|
||||||
def _remove_ips_from_scan_targets(
|
def _remove_ips_from_scan_targets(
|
||||||
scan_targets: List[NetworkAddress], ips_to_remove: List[str]
|
scan_targets: List[NetworkAddress], ips_to_remove: List[str]
|
||||||
) -> List[NetworkAddress]:
|
) -> List[NetworkAddress]:
|
||||||
for ip in ips_to_remove:
|
ips_to_remove_set = set(ips_to_remove)
|
||||||
try:
|
return [address for address in scan_targets if address.ip not in ips_to_remove_set]
|
||||||
scan_targets = [address for address in scan_targets if address.ip != ip]
|
|
||||||
except KeyError:
|
|
||||||
# We don't need to remove the ip if it's already missing from the scan_targets
|
|
||||||
pass
|
|
||||||
return scan_targets
|
|
||||||
|
|
||||||
|
|
||||||
def _get_segmentation_check_targets(
|
def _get_segmentation_check_targets(
|
||||||
|
|
Loading…
Reference in New Issue