diff options
author | gfyoung <gfyoung17@gmail.com> | 2018-11-05 20:45:35 -0800 |
---|---|---|
committer | gfyoung <gfyoung17@gmail.com> | 2018-11-06 22:47:32 -0800 |
commit | 7e6f6e1603d6905be1a7e1b49399b8c778196fc9 (patch) | |
tree | d91be8cfe791d85630f1411a53c63e45632d4478 /lib/gitlab/diff/inline_diff.rb | |
parent | 68cb1e2393ac6d82e012778d44a2e468025936b5 (diff) | |
download | gitlab-ce-7e6f6e1603d6905be1a7e1b49399b8c778196fc9.tar.gz |
Enable even more frozen string in lib/gitlab
Enables frozens string for the following:
* lib/gitlab/conflict/**/*.rb
* lib/gitlab/cross_project_access/**/*.rb
* lib/gitlab/cycle_analytics/**/*.rb
* lib/gitlab/data_builder/**/*.rb
* lib/gitlab/database/**/*.rb
* lib/gitlab/dependency_linker/**/*.rb
* lib/gitlab/diff/**/*.rb
* lib/gitlab/downtime_check/**/*.rb
* lib/gitlab/email/**/*.rb
* lib/gitlab/etag_caching/**/*.rb
Partially addresses gitlab-org/gitlab-ce#47424.
Diffstat (limited to 'lib/gitlab/diff/inline_diff.rb')
-rw-r--r-- | lib/gitlab/diff/inline_diff.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/diff/inline_diff.rb b/lib/gitlab/diff/inline_diff.rb index 72d5ec547da..5815d1bae4a 100644 --- a/lib/gitlab/diff/inline_diff.rb +++ b/lib/gitlab/diff/inline_diff.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module Diff class InlineDiff @@ -71,7 +73,7 @@ module Gitlab def find_changed_line_pairs(lines) # Prefixes of all diff lines, indicating their types # For example: `" - + -+ ---+++ --+ -++"` - line_prefixes = lines.each_with_object("") { |line, s| s << (line[0] || ' ') }.gsub(/[^ +-]/, ' ') + line_prefixes = lines.each_with_object(+"") { |line, s| s << (line[0] || ' ') }.gsub(/[^ +-]/, ' ') changed_line_pairs = [] line_prefixes.scan(LINE_PAIRS_PATTERN) do |