summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-10-27 12:10:24 -0700
committerTim Smith <tsmith84@gmail.com>2020-10-27 12:10:24 -0700
commit24cb7c539e852ca13c535cdf0d9624b5d5f770da (patch)
treecf7987bc940d58f7dedd9e50e76db55a698f865b
parenta8ead1a6bbbbda2eae75bc1fdc4c9858d15c81cb (diff)
downloadchef-24cb7c539e852ca13c535cdf0d9624b5d5f770da.tar.gz
Simplify a weird conditional in chef-configsimplify
if with ! is a brain twister. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb b/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb
index ab51966077..05188d44aa 100644
--- a/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb
+++ b/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb
@@ -21,7 +21,7 @@ module ChefConfig
module FuzzyHostnameMatcher
def fuzzy_hostname_match_any?(hostname, matches)
- if (!hostname.nil?) && (!matches.nil?)
+ unless hostname.nil? || matches.nil?
return matches.to_s.split(/\s*,\s*/).compact.any? do |m|
fuzzy_hostname_match?(hostname, m)
end