Skip to content

Commit

Permalink
chore: static analysis fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rvazarkar committed Feb 13, 2024
1 parent 6886b98 commit 46fcd82
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
14 changes: 0 additions & 14 deletions cmd/api/src/daemons/datapipe/azure_convertors.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,6 @@ const (
PrincipalTypeUser = "User"
)

func convertAzureData(data []json.RawMessage) ConvertedAzureData {
converted := CreateConvertedAzureData(0)
for _, bytes := range data {
var data AzureBase
if err := json.Unmarshal(bytes, &data); err != nil {
log.Error().Fault(err).Msg("Failed to convert Azure data")
} else {
convert := getKindConverter(data.Kind)
convert(data.Data, &converted)
}
}
return converted
}

func getKindConverter(kind enums.Kind) func(json.RawMessage, *ConvertedAzureData) {
switch kind {
case enums.KindAZApp:
Expand Down
6 changes: 3 additions & 3 deletions cmd/api/src/daemons/datapipe/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ type ConvertedData struct {
RelProps []ein.IngestibleRelationship
}

func (s ConvertedData) Clear() {
func (s *ConvertedData) Clear() {
s.NodeProps = make([]ein.IngestibleNode, 0)
s.RelProps = make([]ein.IngestibleRelationship, 0)
}
Expand All @@ -220,7 +220,7 @@ type ConvertedGroupData struct {
DistinguishedNameProps []ein.IngestibleRelationship
}

func (s ConvertedGroupData) Clear() {
func (s *ConvertedGroupData) Clear() {
s.NodeProps = make([]ein.IngestibleNode, 0)
s.RelProps = make([]ein.IngestibleRelationship, 0)
s.DistinguishedNameProps = make([]ein.IngestibleRelationship, 0)
Expand All @@ -230,7 +230,7 @@ type ConvertedSessionData struct {
SessionProps []ein.IngestibleSession
}

func (s ConvertedSessionData) Clear() {
func (s *ConvertedSessionData) Clear() {
s.SessionProps = make([]ein.IngestibleSession, 0)
}

Expand Down
6 changes: 1 addition & 5 deletions packages/go/dawgs/ops/traversal.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,7 @@ func AcyclicTraverseNodes(tx graph.Transaction, plan TraversalPlan, nodeFilter N

// Prevent expansion of already-visited nodes
plan.expansionFilter = func(segment *graph.PathSegment) bool {
if visitedBitmap.CheckedAdd(segment.Node.ID.Uint64()) {
return true
}

return false
return visitedBitmap.CheckedAdd(segment.Node.ID.Uint64())
}

// Wrap our descent filter so we can test candidates
Expand Down

0 comments on commit 46fcd82

Please sign in to comment.