Fix standard ruby style issues

This commit is contained in:
Tim Kächele 2023-10-27 19:14:57 +02:00
parent e92a3b1102
commit 986fc47c73
3 changed files with 4 additions and 7 deletions

View File

@ -10,4 +10,3 @@ gem "rake", "~> 13.0"
gem "rspec", "~> 3.0"
gem "standard", "~> 1.3"

View File

@ -14,7 +14,7 @@ module Rex
def pop_first_order
order = @first_order
@first_order = @first_order.next_order
if @first_order == nil
if @first_order.nil?
@last_order = nil
end
@ -25,11 +25,10 @@ module Rex
def add_order(order)
if empty?
@first_order = order
@last_order = order
else
@last_order.next_order = order
@last_order = order
end
@last_order = order
@order_count += 1
end

View File

@ -2,7 +2,7 @@ require "rbtree"
module Rex
class OrderBook
def initialize()
def initialize
@sell_side = tree_with_limit_default
@buy_side = tree_with_limit_default
end
@ -17,7 +17,6 @@ module Rex
side[order.price].add_order(order)
end
def cancel_order(order_id)
end
@ -25,7 +24,7 @@ module Rex
def tree_with_limit_default
tree = RBTree.new
tree.default_proc = -> (tree, key) { tree[key] = Limit.new(key) }
tree.default_proc = ->(tree, key) { tree[key] = Limit.new(key) }
tree
end
end