Skip to content

Commit

Permalink
BookBuilder: make bids and asks readonly.
Browse files Browse the repository at this point in the history
  • Loading branch information
blair committed Apr 5, 2018
1 parent 178fbee commit 71de334
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/BookBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ export class AggregatedLevelWithOrders extends AggregatedLevel implements PriceL
*/
export class BookBuilder extends EventEmitter implements Orderbook {
public sequence: number = -1;
protected bids: RBTree<AggregatedLevelWithOrders>;
protected asks: RBTree<AggregatedLevelWithOrders>;
protected readonly bids: RBTree<AggregatedLevelWithOrders> = PriceTreeFactory<AggregatedLevelWithOrders>();
protected readonly asks: RBTree<AggregatedLevelWithOrders> = PriceTreeFactory<AggregatedLevelWithOrders>();
protected _bidsTotal: BigJS = ZERO;
protected _bidsValueTotal: BigJS = ZERO;
protected _asksTotal: BigJS = ZERO;
Expand All @@ -159,8 +159,8 @@ export class BookBuilder extends EventEmitter implements Orderbook {
}

clear() {
this.bids = PriceTreeFactory<AggregatedLevelWithOrders>();
this.asks = PriceTreeFactory<AggregatedLevelWithOrders>();
this.bids.clear();
this.asks.clear();
this._bidsTotal = ZERO;
this._asksTotal = ZERO;
this._bidsValueTotal = ZERO;
Expand Down

0 comments on commit 71de334

Please sign in to comment.