Не подтверждена Коммит 4995302d создал по автору Connor Shea's avatar Connor Shea
Просмотр файлов

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.
владелец 4a47470f
......@@ -990,11 +990,12 @@ Performance/RedundantSortBy:
# string.
Performance/StartWith:
Enabled: false
# Use `tr` instead of `gsub` when you are replacing the same number of
# characters. Use `delete` instead of `gsub` when you are deleting
# characters.
Performance/StringReplacement:
Enabled: false
Enabled: true
# TODO: Enable TimesMap Cop.
# Checks for `.times.map` calls.
......
......@@ -18,7 +18,7 @@ def parse(lines)
@lines.each do |line|
next if filename?(line)
full_line = line.gsub(/\n/, '')
full_line = line.delete("\n")
if line.match(/^@@ -/)
type = "match"
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать