Skip to content

Commit

Permalink
standardrb --only Style/StringLiteralsInInterpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
halostatue committed Jul 5, 2022
1 parent e5e7880 commit c00ef1d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/diff/lcs/hunk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ def unified_diff(last = false)
# file -- don't take removed items into account.
lo, hi, num_added, num_removed = @start_old, @end_old, 0, 0

# standard:disable Performance/UnfreezeString
outlist = @data_old[lo..hi].map { |e| String.new("#{encode(" ")}#{e.chomp}") }
# standard:enable Performance/UnfreezeString

last_block = blocks[-1]

Expand Down Expand Up @@ -225,7 +227,9 @@ def context_diff(last = false)
removes = @blocks.reject { |e| e.remove.empty? }

unless removes.empty?
# standard:disable Performance/UnfreezeString
outlist = @data_old[lo..hi].map { |e| String.new("#{encode(" ")}#{e.chomp}") }
# standard:enable Performance/UnfreezeString

last_block = removes[-1]

Expand All @@ -247,7 +251,9 @@ def context_diff(last = false)
inserts = @blocks.reject { |e| e.insert.empty? }

unless inserts.empty?
# standard:disable Performance/UnfreezeString
outlist = @data_new[lo..hi].map { |e| String.new("#{encode(" ")}#{e.chomp}") }
# standard:enable Performance/UnfreezeString

last_block = inserts[-1]

Expand Down

0 comments on commit c00ef1d

Please sign in to comment.