Skip to content

Commit

Permalink
Use each instead of each_with_index
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 committed Sep 20, 2024
1 parent 7a9860b commit 1d2d219
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 1d2d219

Please sign in to comment.