summaryrefslogtreecommitdiff
path: root/lib/gitlab/diff/highlight.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-07-06 19:29:41 -0400
committerDouwe Maan <douwe@selenight.nl>2016-07-06 19:29:41 -0400
commitac26b23712963b0471db9742fc340ea4fb8935a9 (patch)
tree3eb3eea43ed5ffe83b453807ceef00488a0fe2e5 /lib/gitlab/diff/highlight.rb
parent2db75f8debd96c48c6cb8548824dd72bd71fb176 (diff)
downloadgitlab-ce-ac26b23712963b0471db9742fc340ea4fb8935a9.tar.gz
Remove duplication, unused methods, and some other style things
Diffstat (limited to 'lib/gitlab/diff/highlight.rb')
-rw-r--r--lib/gitlab/diff/highlight.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/gitlab/diff/highlight.rb b/lib/gitlab/diff/highlight.rb
index 44ea6bf6102..649a265a02c 100644
--- a/lib/gitlab/diff/highlight.rb
+++ b/lib/gitlab/diff/highlight.rb
@@ -42,11 +42,12 @@ module Gitlab
line_prefix = diff_line.text.match(/\A(.)/) ? $1 : ' '
- if diff_line.unchanged? || diff_line.added?
- rich_line = new_lines[diff_line.new_pos - 1]
- elsif diff_line.removed?
- rich_line = old_lines[diff_line.old_pos - 1]
- end
+ rich_line =
+ if diff_line.unchanged? || diff_line.added?
+ new_lines[diff_line.new_pos - 1]
+ elsif diff_line.removed?
+ old_lines[diff_line.old_pos - 1]
+ end
# Only update text if line is found. This will prevent
# issues with submodules given the line only exists in diff content.