Skip to content

Commit 3b6ad90

Browse files
authored
Merge pull request #9316 from mhashizume/maint/main/assignmentincondition
Lint/AssignmentInCondition
2 parents 7d8b294 + 0cf25bb commit 3b6ad90

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/puppet/pops/loader/static_loader.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ def initialize
4646

4747
def discover(type, error_collector = nil, name_authority = Pcore::RUNTIME_NAME_AUTHORITY)
4848
# Static loader only contains runtime types
49-
return EMPTY_ARRAY unless type == :type && name_authority == name_authority = Pcore::RUNTIME_NAME_AUTHORITY
49+
return EMPTY_ARRAY unless type == :type && name_authority == Pcore::RUNTIME_NAME_AUTHORITY
5050

51-
typed_names = type == :type && name_authority == Pcore::RUNTIME_NAME_AUTHORITY ? @loaded.keys : EMPTY_ARRAY
51+
typed_names = @loaded.keys
5252
block_given? ? typed_names.select { |tn| yield(tn) } : typed_names
5353
end
5454

lib/puppet/util/windows/com.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def initialize(pointer)
141141

142142
self::VTBL.members.each do |name|
143143
define_method(name) do |*args|
144-
if Puppet::Util::Windows::COM.FAILED(result = @vtbl[name].call(self, *args))
144+
if Puppet::Util::Windows::COM.FAILED((result = @vtbl[name].call(self, *args)))
145145
raise Puppet::Util::Windows::Error.new(_("Failed to call %{klass}::%{name} with HRESULT: %{result}.") % { klass: self, name: name, result: result }, result)
146146
end
147147

@@ -183,7 +183,7 @@ def initialize(opts = {})
183183

184184
self::VTBL.members.each do |name|
185185
define_method(name) do |*args|
186-
if Puppet::Util::Windows::COM.FAILED(result = @vtbl[name].call(self, *args))
186+
if Puppet::Util::Windows::COM.FAILED((result = @vtbl[name].call(self, *args)))
187187
raise Puppet::Util::Windows::Error.new(_("Failed to call %{klass}::%{name} with HRESULT: %{result}.") % { klass: self, name: name, result: result }, result)
188188
end
189189

0 commit comments

Comments
 (0)