Skip to content

Commit

Permalink
move check out to reduce redundancy
Browse files Browse the repository at this point in the history
  • Loading branch information
sabotack committed May 13, 2024
1 parent 0155bc8 commit 1de38c1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions p6/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ def process_flows_hour(timestamp, flows, traffic, args, links):
# Get all links in the flow
linksFlow = nwUtils.getLinksFromFlow(flows[flow])

identicalPaths = True
if ratios is not None:
for path in flows[flow]:
if (flow, path) not in ratios:
identicalPaths = False
break

# Update totalTraffic and listFlows for each link
for link in linksFlow:
if link not in links:
Expand All @@ -60,13 +67,6 @@ def process_flows_hour(timestamp, flows, traffic, args, links):
"listFlows": [],
}

identicalPaths = True
if ratios is not None:
for path in flows[flow]:
if (flow, path) not in ratios:
identicalPaths = False
break

totalTraffic = 0
for path in flows[flow]:
if link in path:
Expand Down

0 comments on commit 1de38c1

Please sign in to comment.