Skip to content

Commit

Permalink
revert copyCube
Browse files Browse the repository at this point in the history
  • Loading branch information
Elazar Gershuni committed Mar 3, 2024
1 parent 85b7ab7 commit d5bee5c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pkg/connectionset/statefulness.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package connectionset

import "github.com/np-guard/models/pkg/hypercubes"
import (
"github.com/np-guard/models/pkg/hypercubes"
"github.com/np-guard/models/pkg/intervals"
)

const (
// StatefulUnknown is the default value for a ConnectionSet object,
Expand Down Expand Up @@ -85,3 +88,13 @@ func (conn *ConnectionSet) switchSrcDstPortsOnTCP() *ConnectionSet {
}
return res
}

// copyCube returns a new slice of intervals copied from input cube
func copyCube(cube []*intervals.CanonicalIntervalSet) []*intervals.CanonicalIntervalSet {
newCube := make([]*intervals.CanonicalIntervalSet, len(cube))
for i, interval := range cube {
newInterval := interval.Copy()
newCube[i] = &newInterval
}
return newCube
}

0 comments on commit d5bee5c

Please sign in to comment.