Skip to content

Commit

Permalink
Use each instead of each_with_index (#4641)
Browse files Browse the repository at this point in the history
It is trivial, but apparently index is not used at all in this method.

Signed-off-by: Kentaro Hayashi <[email protected]>
  • Loading branch information
kenhys authored Sep 24, 2024
1 parent 7a9860b commit b5fc93f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/fluent/event_router.rb
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def reset_optimization

def find(tag)
pipeline = nil
@match_rules.each_with_index { |rule, i|
@match_rules.each do |rule|
if rule.match?(tag)
if rule.collector.is_a?(Plugin::Filter)
pipeline ||= Pipeline.new
Expand All @@ -301,7 +301,7 @@ def find(tag)
return pipeline
end
end
}
end

if pipeline
# filter is matched but no match
Expand Down

0 comments on commit b5fc93f

Please sign in to comment.