Skip to content

Commit

Permalink
Remove dead code from oc_to_resource (#852)
Browse files Browse the repository at this point in the history
Since we don't allocate attributes slice explicitly anymore, we don't need to count attributes
  • Loading branch information
dmitryax authored Apr 20, 2020
1 parent 6358a1a commit b5ad68f
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions translator/internaldata/oc_to_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,6 @@ func ocNodeResourceToInternal(ocNode *occommon.Node, ocResource *ocresource.Reso
return
}

// Number of special fields in the Node. See the code below that deals with special fields.
const specialNodeAttrCount = 7

// Number of special fields in the Resource.
const specialResourceAttrCount = 1

// Calculate maximum total number of attributes. It is OK if we are a bit higher than
// the exact number since this is only needed for capacity reservation.
maxTotalAttrCount := 0
if ocNode != nil {
maxTotalAttrCount += len(ocNode.Attributes) + specialNodeAttrCount
}
if ocResource != nil {
maxTotalAttrCount += len(ocResource.Labels) + specialResourceAttrCount
}

dest.InitEmpty()
attrs := dest.Attributes()

Expand Down

0 comments on commit b5ad68f

Please sign in to comment.