Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Shea <connor.james.shea@gmail.com>2016-04-28 03:22:46 +0300
committerConnor Shea <connor.james.shea@gmail.com>2016-05-11 03:34:15 +0300
commit4995302df64b71846370aa80f5b12a2d73112421 (patch)
treed6e0667f4f0399a7a13f17e54fa1860b03a588ed /lib/gitlab/diff
parent4a47470febe34bf67e84a2904422626caa64224e (diff)
Enable the StringReplacement cop.
Also fix one use of `gsub` that would be faster as `delete`. Use `tr` instead of `gsub` when you are replacing the same number of characters. Use `delete` instead of `gsub` when you are deleting characters.
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r--lib/gitlab/diff/parser.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/diff/parser.rb b/lib/gitlab/diff/parser.rb
index d0815fc7eea..6fe7faa547a 100644
--- a/lib/gitlab/diff/parser.rb
+++ b/lib/gitlab/diff/parser.rb
@@ -18,7 +18,7 @@ module Gitlab
@lines.each do |line|
next if filename?(line)
- full_line = line.gsub(/\n/, '')
+ full_line = line.delete("\n")
if line.match(/^@@ -/)
type = "match"