Skip to content

Commit

Permalink
use each with object instead
Browse files Browse the repository at this point in the history
  • Loading branch information
tannalynn committed Jan 19, 2024
1 parent 7cb2d68 commit 9ec2a1b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/new_relic/agent/custom_event_aggregator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def create_custom_event_attributes(attributes)
result = result.first(MAX_ATTRIBUTE_COUNT)
end

result.map do |key, val|
result.each_with_object({}) do |(key, val), new_result|
# name is limited to 255
if key.is_a?(String) && key.bytesize > MAX_NAME_SIZE
key = key.byteslice(0, MAX_NAME_SIZE)
Expand All @@ -75,8 +75,8 @@ def create_custom_event_attributes(attributes)
val = val.byteslice(0, MAX_ATTRIBUTE_SIZE)
end

[key, val]
end.to_h
new_result[key] = val
end
end

def after_initialize
Expand Down

0 comments on commit 9ec2a1b

Please sign in to comment.