diff options
author | Lamont Granquist <454857+lamont-granquist@users.noreply.github.com> | 2022-01-04 12:40:36 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-04 12:40:36 -0800 |
commit | 3c02e500ea7eb2f26ddcc07d031c229ca3365391 (patch) | |
tree | ca8409b4243f0daa48e557d2cae2437ae6335b76 | |
parent | 89b5ac4df012624796a855ceadb9aadd46caa1c6 (diff) | |
parent | 43d45b243d0c54d64b62202710445a70e6d05ac6 (diff) | |
download | chef-3c02e500ea7eb2f26ddcc07d031c229ca3365391.tar.gz |
Merge pull request #12413 from chef/Performance_RedundantSortBlock
-rw-r--r-- | knife/lib/chef/knife/core/generic_presenter.rb | 2 | ||||
-rw-r--r-- | knife/spec/unit/knife/environment_list_spec.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/knife/lib/chef/knife/core/generic_presenter.rb b/knife/lib/chef/knife/core/generic_presenter.rb index 850bfa8b3d..214ffd340b 100644 --- a/knife/lib/chef/knife/core/generic_presenter.rb +++ b/knife/lib/chef/knife/core/generic_presenter.rb @@ -140,7 +140,7 @@ class Chef end def format_list_for_display(list) - config[:with_uri] ? list : list.keys.sort { |a, b| a <=> b } + config[:with_uri] ? list : list.keys.sort end def format_for_display(data) diff --git a/knife/spec/unit/knife/environment_list_spec.rb b/knife/spec/unit/knife/environment_list_spec.rb index 4f44a93f60..5090596815 100644 --- a/knife/spec/unit/knife/environment_list_spec.rb +++ b/knife/spec/unit/knife/environment_list_spec.rb @@ -39,7 +39,7 @@ describe Chef::Knife::EnvironmentList do end it "should print the environment names in a sorted list" do - names = @environments.keys.sort { |a, b| a <=> b } + names = @environments.keys.sort expect(@knife).to receive(:output).with(names) @knife.run end |