Skip to content

Commit

Permalink
check: Expand flow results properly in Merge()
Browse files Browse the repository at this point in the history
Flow result may have FirstMatch but no LastMatch. When merging flow
results extend the range or flows also in this case.

Signed-off-by: Jarno Rajahalme <[email protected]>
  • Loading branch information
jrajahalme authored and jibi committed Jun 21, 2021
1 parent 129a843 commit 6959a88
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions connectivity/check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ func (r *FlowRequirementResults) Merge(from *FlowRequirementResults) {
if r.FirstMatch < 0 || from.FirstMatch >= 0 && from.FirstMatch < r.FirstMatch {
r.FirstMatch = from.FirstMatch
}
if from.FirstMatch > r.LastMatch {
r.LastMatch = from.FirstMatch
}
if from.LastMatch > r.LastMatch {
r.LastMatch = from.LastMatch
}
Expand Down

0 comments on commit 6959a88

Please sign in to comment.