Skip to content

Commit

Permalink
Merge pull request #9316 from mhashizume/maint/main/assignmentincondi…
Browse files Browse the repository at this point in the history
…tion

Lint/AssignmentInCondition
  • Loading branch information
joshcooper authored Apr 10, 2024
2 parents 7d8b294 + 0cf25bb commit 3b6ad90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/puppet/pops/loader/static_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ def initialize

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

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

Expand Down
4 changes: 2 additions & 2 deletions lib/puppet/util/windows/com.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def initialize(pointer)

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

Expand Down Expand Up @@ -183,7 +183,7 @@ def initialize(opts = {})

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

Expand Down

0 comments on commit 3b6ad90

Please sign in to comment.