summaryrefslogtreecommitdiff
path: root/lib/chef/provider/service/macosx.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-12-21 10:43:29 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-12-21 10:43:29 -0800
commita6a880342ff0324df5ebc1192b898af9864d4c34 (patch)
treea7b8f06a3ffaaa1ec2f8d5795945fb2d6083bf6e /lib/chef/provider/service/macosx.rb
parent81e4f3ee85fc4e9bef11c3468dcd1cb8d30f4cea (diff)
downloadchef-a6a880342ff0324df5ebc1192b898af9864d4c34.tar.gz
Style/NumericPredicate comparison stylelcg/numericpredicate
Apparently rubocop thinks the default behavior should be that we have to rewrite every use of `foo == 0` into `foo.zero?` which is a big pile of NOPE for me. After discovering that `.zero?` is actually slower, I'd prefer to go the other direction. Same for `positive?` and `negative?`. These are the only uses of `zero?` in the chef/chef codebase, while I'm pretty sure the inverse rule would touch nearly every file. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/provider/service/macosx.rb')
-rw-r--r--lib/chef/provider/service/macosx.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/provider/service/macosx.rb b/lib/chef/provider/service/macosx.rb
index 8663e7eabf..a5b7976200 100644
--- a/lib/chef/provider/service/macosx.rb
+++ b/lib/chef/provider/service/macosx.rb
@@ -197,7 +197,7 @@ class Chef
case line.downcase
when /\s+\"pid\"\s+=\s+(\d+).*/
pid = $1
- @current_resource.running(!pid.to_i.zero?)
+ @current_resource.running(!pid.to_i == 0)
Chef::Log.debug("Current PID for #{@service_label} is #{pid}")
end
end