diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-07-13 00:02:10 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-07-13 00:02:20 -0500 |
commit | 489e1937043d6f58af28d11831ba6da94e90a705 (patch) | |
tree | 2aeaff4e1563415faec24c70b5ad832ea40d80d5 /lib/gitlab/diff/inline_diff.rb | |
parent | e981d6cd0d6b8ae7d2911a57a65751deaa9ec555 (diff) | |
download | gitlab-ce-489e1937043d6f58af28d11831ba6da94e90a705.tar.gz |
Rename constant to be more descriptive
Diffstat (limited to 'lib/gitlab/diff/inline_diff.rb')
-rw-r--r-- | lib/gitlab/diff/inline_diff.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/diff/inline_diff.rb b/lib/gitlab/diff/inline_diff.rb index 4a3eb92b9fc..28ad637fda4 100644 --- a/lib/gitlab/diff/inline_diff.rb +++ b/lib/gitlab/diff/inline_diff.rb @@ -2,7 +2,7 @@ module Gitlab module Diff class InlineDiff # Regex to find a run of deleted lines followed by the same number of added lines - REGEX = %r{ + LINE_PAIRS_PATTERN = %r{ # Runs start at the beginning of the string (the first line) or after a space (for an unchanged line) (?:\A|\s) @@ -72,7 +72,7 @@ module Gitlab line_prefixes = lines.each_with_object("") { |line, s| s << line[0] }.gsub(/[^ +-]/, ' ') changed_line_pairs = [] - line_prefixes.scan(REGEX) do + line_prefixes.scan(LINE_PAIRS_PATTERN) do # For `"---+++"`, `begin_index == 0`, `end_index == 6` begin_index, end_index = Regexp.last_match.offset(:del_ins) |