diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-28 18:13:55 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-28 18:13:55 +0300 |
commit | 8188ca655a7437381491e565406869c747c1b40a (patch) | |
tree | c9f4295b0ffe7867d9a037d03c926ae65574cb7c /lib | |
parent | 4eac7e06bd6fc1c90a20ae36412b34ac73a15cb2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/database/count/reltuples_count_strategy.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/language_detection.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/database/count/reltuples_count_strategy.rb b/lib/gitlab/database/count/reltuples_count_strategy.rb index 68a0c15480a..f60ead26b03 100644 --- a/lib/gitlab/database/count/reltuples_count_strategy.rb +++ b/lib/gitlab/database/count/reltuples_count_strategy.rb @@ -46,7 +46,7 @@ module Gitlab end def table_to_model_mapping - @table_to_model_mapping ||= models.each_with_object({}) { |model, h| h[model.table_name] = model } + @table_to_model_mapping ||= models.index_by(&:table_name) end def table_to_model(table_name) diff --git a/lib/gitlab/language_detection.rb b/lib/gitlab/language_detection.rb index 6f7fa9fe03b..b259f58350b 100644 --- a/lib/gitlab/language_detection.rb +++ b/lib/gitlab/language_detection.rb @@ -63,7 +63,7 @@ module Gitlab @repository .languages .first(MAX_LANGUAGES) - .to_h { |l| [l[:label], l] } + .index_by { |l| l[:label] } end end end |