summaryrefslogtreecommitdiff
path: root/lib/chef/http/json_output.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-03-11 13:42:34 -0700
committerTim Smith <tsmith@chef.io>2018-03-14 09:51:49 -0700
commit3a7af28896be3702b933bd13dcfff96b98314ebd (patch)
tree23a9b9d00245fe21b81742feefdf31c8549d8b70 /lib/chef/http/json_output.rb
parent02775faa30db6a9ae98597cb6cd0e0c4defa7dc4 (diff)
downloadchef-drop_23.tar.gz
Use match? where we don't need the match datadrop_23
This is a Ruby 2.4-ism that's faster than =~ because it doesn't actually store the match. This is just autocorrected from Rubocop's Performance/RegexpMatch Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/http/json_output.rb')
-rw-r--r--lib/chef/http/json_output.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/http/json_output.rb b/lib/chef/http/json_output.rb
index dc363cdc54..7e8adcec87 100644
--- a/lib/chef/http/json_output.rb
+++ b/lib/chef/http/json_output.rb
@@ -46,7 +46,7 @@ class Chef
# temporary hack, skip processing if return_value is false
# needed to keep conditional get stuff working correctly.
return [http_response, rest_request, return_value] if return_value == false
- if http_response["content-type"] =~ /json/
+ if http_response["content-type"].match?(/json/)
if http_response.body.nil?
return_value = nil
elsif raw_output