summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Ziegler <austin@zieglers.ca>2021-12-23 11:37:31 -0500
committerAustin Ziegler <austin@zieglers.ca>2021-12-23 11:45:41 -0500
commit4b7f9909d6c303556b4883ba1d447ac6b15df2f9 (patch)
treed2fe9c232f5c9f907ca82479ba60356d88d5bd18
parentfb297ea2166e3fe37d97aa85602ca4ffe120f709 (diff)
downloaddiff-lcs-4b7f9909d6c303556b4883ba1d447ac6b15df2f9.tar.gz
standardrb --only Style/StringLiteralsInInterpolation
-rw-r--r--lib/diff/lcs/hunk.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/diff/lcs/hunk.rb b/lib/diff/lcs/hunk.rb
index 8da65c2..2cef5ed 100644
--- a/lib/diff/lcs/hunk.rb
+++ b/lib/diff/lcs/hunk.rb
@@ -171,7 +171,9 @@ class Diff::LCS::Hunk
# 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]
@@ -225,7 +227,9 @@ class Diff::LCS::Hunk
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]
@@ -247,7 +251,9 @@ class Diff::LCS::Hunk
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]