diff options
author | Tim Smith <tsmith@chef.io> | 2022-01-04 12:45:20 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-04 12:45:20 -0800 |
commit | 00cf514423a905693f8a5b81ac725c40550f5b79 (patch) | |
tree | 42301858e45ad74572825ddd0d53d9527b519457 /lib | |
parent | f9fb231d9080192b31728d31c56de9d009941637 (diff) | |
download | chef-00cf514423a905693f8a5b81ac725c40550f5b79.tar.gz |
Resolve Performance/Count warning (#12410)
Use .count not .select and .length
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/secret_fetcher/azure_key_vault.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/secret_fetcher/azure_key_vault.rb b/lib/chef/secret_fetcher/azure_key_vault.rb index c4bdd2b3ce..da7f0d2da5 100644 --- a/lib/chef/secret_fetcher/azure_key_vault.rb +++ b/lib/chef/secret_fetcher/azure_key_vault.rb @@ -59,7 +59,7 @@ class Chef end def validate! - raise Chef::Exceptions::Secret::ConfigurationInvalid, "You may only specify one (these are mutually exclusive): :object_id, :client_id, or :mi_res_id" if [object_id, client_id, mi_res_id].select { |x| !x.nil? }.length > 1 + raise Chef::Exceptions::Secret::ConfigurationInvalid, "You may only specify one (these are mutually exclusive): :object_id, :client_id, or :mi_res_id" if [object_id, client_id, mi_res_id].count { |x| !x.nil? } > 1 end private |