diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-10-16 10:45:38 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-10-16 10:45:38 -0700 |
commit | e8fc42c1d6a72e1646e3e25268e7cede48296eda (patch) | |
tree | 2651f5ee9fe8f95a4620f913e22244ad6aa552d0 | |
parent | d5eb0b6c75adadc0e1e1e7c06e7b744e6bc1963b (diff) | |
download | chef-e8fc42c1d6a72e1646e3e25268e7cede48296eda.tar.gz |
Avoid a slow hash merge
This is 2.66X slower than just throwing the data in there.
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/chef/provider/package/freebsd/base.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/provider/package/freebsd/base.rb b/lib/chef/provider/package/freebsd/base.rb index 2805200516..477dc02e2a 100644 --- a/lib/chef/provider/package/freebsd/base.rb +++ b/lib/chef/provider/package/freebsd/base.rb @@ -58,7 +58,8 @@ class Chef def makefile_variable_value(variable, dir = nil) options = dir ? { cwd: dir } : {} - options.merge!(env: nil, returns: [0, 1]) + options[:env] = nil + options[:returns] = [0, 1] make_v = shell_out!("make", "-V", variable, **options) make_v.exitstatus == 0 ? make_v.stdout.strip.split($OUTPUT_RECORD_SEPARATOR).first : nil # $\ is the line separator, i.e. newline. end |