Commit ad2679b4 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
Browse files

Merge branch 'sh-rubocop-reverse-each' into 'master'

Enable Rubocop Performance/ReverseEach

See merge request gitlab-org/gitlab-ce!31120
......@@ -262,14 +262,6 @@ Naming/HeredocDelimiterNaming:
Naming/RescuedExceptionsVariableName:
Enabled: false
# Offense count: 3
# Cop supports --auto-correct.
Performance/ReverseEach:
Exclude:
- 'app/models/commit.rb'
- 'db/migrate/20190222051615_add_indexes_for_merge_request_diffs_query.rb'
- 'lib/gitlab/profiler.rb'
# Offense count: 7081
# Configuration parameters: Prefixes.
# Prefixes: when, with, without
......
......@@ -346,7 +346,7 @@ def cherry_pick_description(user)
if commits_in_merge_request.present?
message_body << ""
commits_in_merge_request.reverse.each do |commit_in_merge|
commits_in_merge_request.reverse_each do |commit_in_merge|
message_body << "#{commit_in_merge.short_id} #{commit_in_merge.title}"
end
end
......
......@@ -35,7 +35,7 @@ def up
end
def down
INDEX_SPECS.reverse.each do |spec|
INDEX_SPECS.reverse_each do |spec|
remove_concurrent_index(*spec)
end
end
......
......@@ -166,7 +166,7 @@ def self.log_load_times_by_model(logger)
[model, times.count, times.sum]
end
summarised_load_times.sort_by(&:last).reverse.each do |(model, query_count, time)|
summarised_load_times.sort_by(&:last).reverse_each do |(model, query_count, time)|
logger.info("#{model} total (#{query_count}): #{time.round(2)}ms")
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment