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
path: root/qa/spec
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-07-24 21:11:18 +0300
committerStan Hu <stanhu@gmail.com>2019-07-24 21:47:58 +0300
commit3e001d29ccdb5a5b1ba223710525f8dc7ae844ee (patch)
tree5046754a8858795a02043a743e18fb8b05610f41 /qa/spec
parent0d538e44aff066372ecd9d10ac6786681bc347c9 (diff)
Enable Rubocop Performance/InefficientHashSearch
When used with a Hash, `.keys.include?` is bad because: 1. It performs a O(n) search instead of the efficient `.has_key?` 2. It clones all keys into separate array. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64975
Diffstat (limited to 'qa/spec')
-rw-r--r--qa/spec/spec_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/qa/spec/spec_helper.rb b/qa/spec/spec_helper.rb
index 21bfd2876a9..363980acc33 100644
--- a/qa/spec/spec_helper.rb
+++ b/qa/spec/spec_helper.rb
@@ -46,7 +46,7 @@ RSpec.configure do |config|
if ENV['CI']
config.around do |example|
- retry_times = example.metadata.keys.include?(:quarantine) ? 1 : 2
+ retry_times = example.metadata.key?(:quarantine) ? 1 : 2
example.run_with_retry retry: retry_times
end
end