Skip to content

Commit

Permalink
Use assignment to avoid temporary hash allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
repeatedly committed Nov 14, 2016
1 parent dcff2b9 commit 6367d0c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/fluent/plugin/filter_record_transformer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,9 @@ def filter_stream(tag, es)
last_record = nil
es.each do |time, record|
last_record = record # for debug log
placeholder_values.merge!({
'time' => @placeholder_expander.time_value(time),
'record' => record,
})
placeholder_values['time'] = @placeholder_expander.time_value(time)
placeholder_values['record'] = record

new_record = reform(record, placeholder_values)
if @renew_time_key && new_record.has_key?(@renew_time_key)
time = Fluent::EventTime.from_time(Time.at(new_record[@renew_time_key].to_f))
Expand Down

0 comments on commit 6367d0c

Please sign in to comment.