diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-11-15 15:16:07 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-12-06 13:08:26 -0800 |
commit | faa499f9fd646ccdc05d7520512c087d672f755d (patch) | |
tree | 643b56d26de3dfe6c2f04613d242eb950aec6ee6 /lib/chef/win32 | |
parent | 76427185b3dddfc9901dc2cbe5f1f7a6c9af661c (diff) | |
download | chef-faa499f9fd646ccdc05d7520512c087d672f755d.tar.gz |
fix Style/NonNilCheck
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/win32')
-rw-r--r-- | lib/chef/win32/memory.rb | 2 | ||||
-rw-r--r-- | lib/chef/win32/security/sid.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/win32/memory.rb b/lib/chef/win32/memory.rb index 49dcdfbd41..2a9d5d8eb5 100644 --- a/lib/chef/win32/memory.rb +++ b/lib/chef/win32/memory.rb @@ -35,7 +35,7 @@ class Chef Chef::ReservedNames::Win32::Error.raise! end # If a block is passed, handle freeing the memory at the end - if block != nil + if !block.nil? begin yield result ensure diff --git a/lib/chef/win32/security/sid.rb b/lib/chef/win32/security/sid.rb index f6b88c60ce..983166ac70 100644 --- a/lib/chef/win32/security/sid.rb +++ b/lib/chef/win32/security/sid.rb @@ -50,7 +50,7 @@ class Chef end def ==(other) - other != nil && Chef::ReservedNames::Win32::Security.equal_sid(self, other) + !other.nil? && Chef::ReservedNames::Win32::Security.equal_sid(self, other) end attr_reader :pointer @@ -61,7 +61,7 @@ class Chef def account_name domain, name, use = account - (domain != nil && domain.length > 0) ? "#{domain}\\#{name}" : name + (!domain.nil? && domain.length > 0) ? "#{domain}\\#{name}" : name end def size |