Island: Simplify _get_exploit_counts()

This commit is contained in:
Mike Salvatore 2021-07-12 11:54:39 -04:00
parent 06439d92f9
commit 9e7e58658c
1 changed files with 2 additions and 6 deletions

View File

@ -18,11 +18,7 @@ def _get_exploit_counts(exploited: List[Dict]) -> Dict:
exploit_counts = {}
for node in exploited:
exploits = node["exploits"]
for exploit in exploits:
if exploit in exploit_counts:
exploit_counts[exploit] += 1
else:
exploit_counts[exploit] = 1
for exploit in node["exploits"]:
exploit_counts[exploit] = exploit_counts.get(exploit, 0) + 1
return exploit_counts