Skip to content

Commit

Permalink
refactor: move slide const out func to improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
noly committed Oct 9, 2020
1 parent 428637d commit e6ca59e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/integrations/v4/protocol/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const (

const millisSinceJanuaryFirst1978 = 252489600000

var acceptedAttribute = []string{"summary", "category", "entity_name", "format", "local_identity", "local_details"}

type DataV4 struct {
PluginProtocolVersion
Integration IntegrationMetadata `json:"integration"`
Expand Down Expand Up @@ -158,7 +160,6 @@ func NewEventData(options ...func(EventData)) (EventData, error) {
// valid keys: ["summary", "category", "entity_name", "format", "local_identity", "local_details"]
func WithEvents(original EventData) func(EventData) {
return func(copy EventData) {
acceptedAttribute := []string{"summary", "category", "entity_name", "format", "local_identity", "local_details"}
for _, key := range acceptedAttribute {
if val, ok := original[key]; ok {
copy[key] = val
Expand Down

0 comments on commit e6ca59e

Please sign in to comment.