diff options
author | Tim Smith <tsmith84@gmail.com> | 2021-12-26 18:39:27 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2021-12-26 18:39:27 -0800 |
commit | 02d61432bcda69d9670b3b08e899ff16cb0abae1 (patch) | |
tree | aab63d43324df97dcc3e98287ecfc0c003100323 | |
parent | 50a0001bae754c66feb69c84b64cb305a03a34d2 (diff) | |
download | chef-Performance_Count.tar.gz |
Resolve Performance/Count warningPerformance_Count
Use .count not .select and .length
Signed-off-by: Tim Smith <tsmith@chef.io>
-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 d9acc7c3d0..2734234bd4 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 |