summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-07-24 14:08:25 -0700
committerStan Hu <stanhu@gmail.com>2019-07-24 14:08:25 -0700
commit07a308ad1b3e4ac1c6a3d81a60dac5c4254281b9 (patch)
tree0f58b00d10eda0d7ee97255002bf051205db6dae /db
parent35ec674ee69a04d771ed82eeb205c3cd527e4112 (diff)
downloadgitlab-ce-07a308ad1b3e4ac1c6a3d81a60dac5c4254281b9.tar.gz
Enable Rubocop Performance/ReverseEachsh-rubocop-reverse-each
`Array.reverse_each` is faster than `Array.reverse.each` because: * reverse.each creates a new array then loops each element * reverse_each loops in reverse order (no intermediate array created)
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20190222051615_add_indexes_for_merge_request_diffs_query.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/db/migrate/20190222051615_add_indexes_for_merge_request_diffs_query.rb b/db/migrate/20190222051615_add_indexes_for_merge_request_diffs_query.rb
index 0048268ca6f..bf7f7b44dec 100644
--- a/db/migrate/20190222051615_add_indexes_for_merge_request_diffs_query.rb
+++ b/db/migrate/20190222051615_add_indexes_for_merge_request_diffs_query.rb
@@ -35,7 +35,7 @@ class AddIndexesForMergeRequestDiffsQuery < ActiveRecord::Migration[5.0]
end
def down
- INDEX_SPECS.reverse.each do |spec|
+ INDEX_SPECS.reverse_each do |spec|
remove_concurrent_index(*spec)
end
end