Skip to content

Commit 0cf25bb

Browse files
committed
Lint/AssignmentInCondition
This commit takes variable assignments in conditionals and wraps them in parentheses to make the intention more explicit.
1 parent bfdb813 commit 0cf25bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)