Skip to content

Commit

Permalink
Remove then keywords from if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
herwinw committed Sep 4, 2024
1 parent caab355 commit d82a2d4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/xmlrpc/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module XMLRPC # :nodoc:
#
# server = XMLRPC::Client.new("www.ruby-lang.org", "/RPC2", 80)
# ok, param = server.call2("michael.add", 4, 5)
# if ok then
# if ok
# puts "4 + 5 = #{param}"
# else
# puts "Error:"
Expand Down
8 changes: 4 additions & 4 deletions lib/xmlrpc/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def nodeMustBe(node, name)
raise "error"
end

if not cmp then
if not cmp
raise "wrong xml-rpc (name)"
end

Expand All @@ -217,14 +217,14 @@ def hasOnlyOneChild(node, name=nil)
if node.childNodes.to_a.size != 1
raise "wrong xml-rpc (size)"
end
if name != nil then
if name != nil
nodeMustBe(node.firstChild, name)
end
end


def assert(b)
if not b then
if not b
raise "assert-fail"
end
end
Expand Down Expand Up @@ -436,7 +436,7 @@ def methodCall(node)
assert( (1..2).include?( node.childNodes.to_a.size ) )
name = methodName(node[0])

if node.childNodes.to_a.size == 2 then
if node.childNodes.to_a.size == 2
pa = params(node[1])
else # no parameters given
pa = []
Expand Down
4 changes: 2 additions & 2 deletions lib/xmlrpc/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ def set_parser(parser)

def create
# if set_writer was not already called then call it now
if @create.nil? then
if @create.nil?
set_writer(Config.default_writer.new)
end
@create
end

def parser
# if set_parser was not already called then call it now
if @parser.nil? then
if @parser.nil?
set_parser(Config.default_parser.new)
end
@parser
Expand Down

0 comments on commit d82a2d4

Please sign in to comment.