Skip to content

Commit

Permalink
position_file: Use ternary operator on #[]
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <hatake@clear-code.com>
  • Loading branch information
cosmo0920 committed Dec 11, 2020
1 parent a106a03 commit ab4c583
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/fluent/plugin/in_tail/position_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ def initialize(file, follow_inodes, existing_paths, logger: nil)
end

def [](target_info)
if @follow_inodes && m = @map[target_info.ino]
return m
elsif !@follow_inodes && m = @map[target_info.path]
if m = @map[@follow_inodes ? target_info.ino : target_info.path]
return m
end

Expand Down

0 comments on commit ab4c583

Please sign in to comment.